Newer Version Available
DmlOptions.EmailHeader Class
Namespace
Usage
Even though auto-sent emails can be triggered by actions in the Salesforce user interface, the DMLOptions settings for emailHeader take effect only for DML operations carried out in Apex code.
Example
1Account a = new Account(name='Acme Plumbing');
2
3insert a;
4
5Contact c = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber', accountid=a.id);
6
7insert c;
8
9Database.DMLOptions dlo = new Database.DMLOptions();
10
11dlo.EmailHeader.triggerAutoResponseEmail = true;
12
13Case ca = new Case(subject='Plumbing Problems', contactid=c.id);
14
15database.insert(ca, dlo);DmlOptions.EmailHeader Properties
The following are properties for DmlOptions.EmailHeader.
triggerAutoResponseEmail
Signature
public Boolean triggerAutoResponseEmail {get; set;}
Property Value
Type: Boolean
Usage
This email can be automatically triggered by a number of events, for example creating a case or resetting a user password. If this value is set to true, when a case is created, if there is an email address for the contact specified in ContactID, the email is sent to that address. If not, the email is sent to the address specified in SuppliedEmail
triggerOtherEmail
Signature
public Boolean triggerOtherEmail {get; set;}
Property Value
Type: Boolean
Usage
This email can be automatically triggered by creating, editing, or deleting a contact for a case.
triggerUserEmail
Signature
public Boolean triggerUserEmail {get; set;}
Property Value
Type: Boolean
Usage
This email can be automatically triggered by a number of events; resetting a password, creating a new user, or creating or modifying a task.