Use an email template to design a reusable email layout for your engagement programs, autoresponders, one-to-one emails, and list emails. Learn about email templates in Salesforce Help.
The API to access the email template object follows the conventions described in Version 5 Overview.
An array of sender options. Values are general_user, specific_user, account_owner, prospect_custom_field (Read and Query only), account_custom_field (Read and Query only)
trackerDomainId
Integer
The ID of the tracker domain associated with this object.
folderId
Integer
ID of the folder containing this object.
type
Enum
The content type of the email. Possible values are html (Read and Query only), text, and htmlAndText.
campaignId
Integer
The ID of the campaign associated with this object.
An array of reply to address options. Values are general_address, specific_user, account_owner, prospect_custom_field (Read and Query only), account_custom_field (Read and Query only)
Read-Only Fields
Field
Type
Description
id
Integer
ID of the email template.
isDeleted
Boolean
True if the object is in the recycle bin in Account Engagement.
createdAt
Datetime
Time the email template was created; reported in API user’s timezone.
updatedAt
Datetime
Time the email template last updated; reported in API user’s timezone.
Tracker Domain object representing the tracker domain associated with the email template. See documentation for Tracker Domain for fields.
tagReplacementLanguage
Enum
Merge language of the email template. Can be "pml", "hml", or "undetermined".
senderOptions Fields
Field Name
Data Type
Description
senderOptions.type
Enum
The sending user type. Can be general_user, specific_user, assigned_user or account_owner. When performing read or query, account_custom_field and prospect_custom_field are also available.
senderOptions.address
String
The sending email address.
senderOptions.name
String
The name of the sender.
senderOptions.userId
Integer
The user ID of the sender.
senderOptions.prospectCustomFieldId
Integer
The ID of the prospect custom field that contains the sender value. Only available on read and query.
senderOptions.accountCustomFieldId
Integer
The ID of the account custom field that contains the sender value. Only available on read and query.
replyToOptions Fields
Field Name
Data Type
Description
replyToOptions.type
Enum
The reply to user type. Can be general_address, specific_user, assigned_user or account_owner. When performing read or query, account_custom_field and prospect_custom_field are also available.
replyToOptions.address
String
The reply-to email address.
replyToOptions.userId
Integer
The user ID of the reply to sender.
replyToOptions.prospectCustomFieldId
Integer
The ID of the prospect custom field that contains the reply to value.
replyToOptions.accountCustomFieldId
Integer
The ID of the account custom field that contains the reply to value.
Email Template Create
Create a single email template following the conventions described in the Version 5 Overview.
When the Create request succeeds, the email template is considered Published and skips the Draft state.
1{2 "id": 20587,3 "campaignId": 28215,4 "createdById": 2479182,5 "isAutoResponderEmail": true,6 "isDeleted": false,7 "isDripEmail": true,8 "isListEmail": true,9 "isOneToOneEmail": false,10 "name": "Competitive Landscape",11 "subject": "How Does LenoxSoft Compare?",12 "textMessage": "The new generation of accounting software.\nLead with LenoxSoft.\n\n%%first_name%%,\nLenoxSoft was built with %%company%% in mind, and offers a full-featured suite of accounting and expense management tools to help keep your business humming.",13 "type": "htmlandtext",14 "updatedAt": "2021-05-18T16:59:40-07:00",15 "updatedById": 247918216}
Email Template Update
Updates an email template following the conventions described in the Version 5 Overview.
After the Update request succeeds, the email template is considered Published and skips the Draft state.
When executing a query, the following fields can be specified in the orderBy parameter. See the conventions for query described in the Version 5 Overview.
Parameter
Description
id
ID of the email template.
createdAt
Time the email template was created; reported in API user’s timezone.
updatedAt
Time the email template last updated; reported in API user’s timezone.
Filtering Results
When executing a query, the following parameters can be used to filter the returned results. These parameters can be specified in the request along with any shared parameters defined in Version 5 Overview. When specifying more than one parameter, all parameters must match the record in order for it to be returned in the results.
Parameter
Description
id
Returns any email templates where ID is equal to the given integer value.
idList
Returns any email templates where ID is included in the given list of values.
idGreaterThan
Returns any email templates where ID is greater than the specified value, non-inclusive.
idGreaterThanOrEqualTo
Returns any email templates where ID is greater than or equal to the specified value.
idLessThan
Returns any email templates where ID is less than the specified value, non-inclusive.
idLessThanOrEqualTo
Returns any email templates where ID is less than or equal to the specified value.
name
Returns any email templates where Name is equal to the given string value.
createdAt
Returns any email templates where CreatedAt is equal to the given datetime value.
createdAtAfter
Returns any email templates where CreatedAt is after the given datetime value, non-inclusive.
createdAtAfterOrEqualTo
Returns any email templates where CreatedAt is after or equal to the given datetime value.
createdAtBefore
Returns any email templates where CreatedAt is before the given datetime value, non-inclusive.
createdAtBeforeOrEqualTo
Returns any email templates where CreatedAt is before or equal to the given datetime value.
updatedAt
Returns any email templates where UpdatedAt is equal to the given datetime value.
updatedAtAfter
Returns any email templates where UpdatedAt is after the given datetime value, non-inclusive.
updatedAtAfterOrEqualTo
Returns any email templates where UpdatedAt is after or equal to the given datetime value.
updatedAtBefore
Returns any email templates where UpdatedAt is before the given datetime value, non-inclusive.
updatedAtBeforeOrEqualTo
Returns any email templates where UpdatedAt is before or equal to the given datetime value.
deleted
Determines whether to return deleted records. The value can be false (default), true, or all.
isOneToOne
If True, the template is available for one-to-one emails.
Add Tag
Adds a Tag to the Email Template object, which creates a TaggedObject.