EmailHeader
The Salesforce user interface allows you to specify whether to send an email when these events occur:
- Create a Case
- Create a CaseComment
- Convert Case email to a Contact
- Send a New User email notification
- Make a
resetPassword()call
In API versions 8.0 and later, you can also send an API request that sends email.
A group event is an Event for which IsGroupEvent is true. The EventRelation object tracks the users, leads, or contacts that are invited to a group event. Note the following behaviors for group event email sent through the API:
- Sending a group event invitation to a IUser respects the
triggerUserEmailoption - Sending a group event invitation to a Lead or Contact respects the
triggerOtherEmailoption - Email sent when updating or deleting a group event also respect
triggerUserEmailandtriggerOtherEmail, as appropriate
create(), delete(), resetPassword(), update(), upsert()
Type: boolean
Description: Indicates whether to trigger auto-response rules (true) or not (false), for leads and cases. In the Salesforce user interface, 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.
Type: boolean
Description: Indicates whether to trigger email outside the organization (true) or not (false). In the Salesforce user interface, this email can be automatically triggered by creating, editing, or deleting a contact for a case.
Type: boolean
Description: Indicates whether to trigger email that is sent to users in the organization (true) or not (false). In the Salesforce user interface, this email can be automatically triggered by a number of events; resetting a password, creating a new user, or adding comments to a case.
This sample shows how to use the EmailHeader. It sets the triggerAutoResponseEmail email header field to true, which triggers an email to be sent when a case is created. Next, it creates a case. This sample assumes an auto-response rule has been set for cases, and an email address is specified in the contact referenced by ContactId.