Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
ApexEmailNotifications
Declarative Metadata File Suffix and Directory Location
The component filename is apexEmailNotifications.notifications. The Apex email notification file is stored in the apexEmailNotifications folder in the corresponding package directory.
Version
ApexEmailNotifications components are available in API version 49.0 and later.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| apexEmailNotification | ApexEmailNotification | A specific Apex email notification. You can specify multiple notifications. |
ApexEmailNotification
Represents an Apex email notification.
| Field Name | Field Type | Description |
|---|---|---|
| string | The external email address to which the notification is sent. Mutually exclusive with the user field. | |
| user | string | The username of the Salesforce user to be notified. Mutually exclusive with the email field. |
Usage
1<?xml version="1.0" encoding="UTF-8"?>
2<ApexEmailNotifications xmlns="http://soap.sforce.com/2006/04/metadata">
3 <apexEmailNotification>
4 <email>test2@example.com</email>
5 </apexEmailNotification>
6</ApexEmailNotifications>Declarative Metadata Sample Definition
To deploy Apex email notifications, you can specify either the exact file name or use a wildcard in package.xml.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>apexEmailNotifications</members>
5 <name>ApexEmailNotifications</name>
6 </types>
7 <version>49.0</version>
8</Package>1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>ApexEmailNotifications</name>
6 </types>
7 <version>49.0</version>
8</Package>1<?xml version="1.0" encoding="UTF-8"?>
2<ApexEmailNotifications xmlns="http://soap.sforce.com/2006/04/metadata">
3 <apexEmailNotification>
4 <user>user1@example.com</user>
5 </apexEmailNotification>
6</ApexEmailNotifications>1<?xml version="1.0" encoding="UTF-8"?>
2<ApexEmailNotifications xmlns="http://soap.sforce.com/2006/04/metadata">
3 <apexEmailNotification>
4 <email>test@example.com</email>
5 </apexEmailNotification>
6</ApexEmailNotifications>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.