Newer Version Available
EmailHeader
- Create a Case
- Create a CaseComment
- Convert Case email to a Contact
- Send a New User email notification
- Make a resetPassword() call
API Calls
Fields
| Element Name | Type | Description |
|---|---|---|
| triggerAutoResponseEmail | boolean |
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. |
| triggerOtherEmail | boolean |
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. |
| triggerUserEmail | boolean |
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. |
Sample Code—Java
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.
1public void createCaseWithAutoResponse(String contactId) {
2 try {
3 connection.setEmailHeader(true, false, false);
4 Case c = new Case();
5 c.setSubject("Sample Subject");
6 c.setContactId(contactId);
7 SaveResult[] sr = connection.create(new SObject[] { c });
8 // Parse sr array to see if case was created successfully.
9 } catch (ConnectionException ce) {
10 ce.printStackTrace();
11 }
12}