EmailTemplate
Represents a template for an email, mass email, list email, or Sales Engagement email. Supported in first-generation managed packages only.
Introduced in API version 8.0.
create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), update(), upsert()
- Customer Portal users can’t access this object.
- Type: double
- Properties: Create, Filter, Nillable, Sort, Update
- Introduced: API version 14.0
- Description: The API version for this class. Every class has an API version specified at creation.
- Type: textarea
- Properties: Create, Nillable, Update
- Description: Content of the email. Limit: 384 KB.
- Type: reference
- Properties: Create, Filter, Group, Nillable, Sort, Update
- Description: Required. ID of the BrandTemplate associated with this email template. The brand template supplies letterhead information for the email template.
- Relationship name: BrandTemplate
- Relationship type: relationship
- Refers to: BrandTemplate
- Type: percent
- Properties: Filter, Nillable, Sort
- Introduced: API version 46.0
- Description: Read-only. The percentage of the emails that were delivered compared to the number that bounced (soft and hard). Note: this data includes emails that were delivered to the recipient’s spam folder. To access this field, your org must use Sales Engagement and users need the Sales Engagement User or Sales Engagement Cadence Creator permission set. This field value includes emails sent via the ListEmail object or Sales Engagement cadences.
- Type: string
- Properties: Create, Filter, Nillable, Sort, Update
- Description: Description of the template, for example, Promotion Mass Mailing.
-
Type: string
-
Properties: Create, Defaulted on create, Filter, Group, Sort, Update
-
Introduced: API version 14.0
-
Description: The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization. Label is Template Unique Name.
When creating large sets of data, always specify a unique
DeveloperNamefor each record. If noDeveloperNameis specified, performance may slow while Salesforce generates one for each record.
- Type: picklist
- Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
- Description: Character set encoding for the template.
-
Type: reference
-
Properties: Create, Filter, Group, Nillable, Sort, Update
-
Description:
ID of the enhanced letterhead associated with the email template.
This is a relationship field.
-
Relationship name: EnhancedLetterhead
-
Relationship type: relationship
-
Refers to: EnhancedLetterhead
To use an enhanced letterhead, associate it with a Lightning email template that uses the HML merge language.
-
Type: reference
-
Properties: Create, Filter, Group, Sort, Update
-
Description:
ID of the folder that contains the template.
This is a relationship field.
-
Relationship name: Folder
-
Relationship type: polymorphic
-
Refers to: Folder, Organization, User
- Type: string
- Properties: Filter, Nillable, Sort
- Introduced: API version 45.0
- Description: The name of the folder that contains the template.
- Type: boolean
- Properties: Defaulted on create, Filter, Group, Sort
- Introduced: API version 50.0
- Description: If the email template has attachments from Salesforce Files. The default value is false.
- Default value: false
- Type: textarea
- Properties: Create, Nillable, Update
- Description: This field contains the content of the email message, including HTML coding to render the email message. Limit: 384 KB.
- Type: boolean
- Properties: Create, Defaulted on create, Filter, Group, Sort, Update
- Description: Indicates that this template is active if
true, or inactive iffalse. - Default value: false
- Type: boolean
- Properties: Defaulted on create, Filter, Group, Sort
- Introduced: API version 50.0
- Description: If the email template was made in Email Template Builder. The default value is false.
- Default value: false
-
Type: datetime
-
Properties: Filter, Nillable, Sort
-
Introduced: API version 8.0
-
Description:
Date and time when this email template was last used.
Used with Salesforce Classic templates.
Not typically used with Lightning Experience templates.
- Type: textarea
- Properties: Create, Nillable, Update
- Introduced: API version 14.0
- Description: The Visualforce markup, HTML, JavaScript, or any other Web-enabled code that defines the content of the template.
- Type: string
- Properties: Create, Filter, Group, idLookup, Sort, Update
- Description: Name of the template. Label is Email Template Name.
-
Type: string
-
Properties: Filter, Group, Nillable, Sort
-
Introduced: API version 14.0
-
Description:
The namespace prefix that is associated with this object. Each Developer Edition org that creates a managed package has a unique namespace prefix. Limit: 15 characters. You can refer to a component in a managed package by using the
namespacePrefix__componentNamenotation.The namespace prefix can have one of the following values.
- In Developer Edition orgs,
NamespacePrefixis set to the namespace prefix of the org for all objects that support it, unless an object is in an installed managed package. In that case, the object has the namespace prefix of the installed managed package. This field’s value is the namespace prefix of the Developer Edition org of the package developer. - In orgs that are not Developer Edition orgs,
NamespacePrefixis set only for objects that are part of an installed managed package. All other objects have no namespace prefix.
This field can’t be accessed unless the logged-in user has the Customize Application permission.
- In Developer Edition orgs,
-
Type: picklist
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Introduced: API version 39.0
-
Description:
When
UITypeis2(Lightning Experience) or3(Lightning ExperienceSample),RelatedEntityTypeindicates which entities this template can be used with. Valid values are the entity API name: “Account” for account, “Contact” for contact, “Opportunity” for opportunity, “Lead” for lead, and so on. The value can be any entity the user has read access to (including custom entities) but not virtual entities, setup entities, or platform entities.No restrictions exist at the schema level.
-
Type: string
-
Properties: Create, Nillable, Sort, Update
-
Description:
Content of the subject line.
The limit is 1,000 characters for Lightning email templates and 230 characters for Classic email templates.
- Type: picklist
- Properties: Create, Filter, Group, Restricted picklist, Sort
- Description: Style of the template.
- Possible values:
- formalLetter — formalLetter — Formal Letter
- freeForm — freeForm — Free Form Letter
- newsletter — newsletter
- none — none — No Email Layout
- products — products
- promotionLeft — promotionLeft — Promotion (Left)
- promotionRight — promotionRight — Promotion (Right)
- Type: picklist
- Properties: Create, Filter, Group, Restricted picklist, Sort
- Description: Type of template.
- Possible values:
- custom — custom
- html — html
- text — text
- visualforce — visualforce
-
Type: int
-
Properties: Filter, Group, Nillable, Sort
-
Introduced: API version 8.0
-
Description:
Number of times this email template has been used.
Used with Salesforce Classic templates.
Not typically used with Lightning Experience templates.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- Description: Read-only. The total number of emails sent minus hard and soft bounces. Note: this data includes emails that were delivered to the recipient’s spam folder. To access this field, your org must use Sales Engagement and users need the Sales Engagement User or Sales Engagement Cadence Creator permission set. This field value includes emails sent via the ListEmail object or Sales Engagement cadences.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- Description: Read-only. The total number of emails that permanently bounced back to the sender because the address is invalid. A hard bounce can occur because the domain name doesn’t exist or because the recipient is unknown. To access this field, your org must use Sales Engagement and users need the Sales Engagement User or Sales Engagement Cadence Creator permission set. This field value includes emails sent via the ListEmail object or Sales Engagement cadences.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- Description: Read-only. The total number of times a prospect’s email client loaded the images in the HTML version of the email. We also record an open if the prospect clicks a link within the HTML or text email without downloading images. A click indicates that they viewed the message. Some email clients (Outlook, Apple Mail, Thunderbird) don’t display images by default. Pardot counts an open each time the images load. To access this field, your org must use Sales Engagement and users need the Sales Engagement User or Sales Engagement Cadence Creator permission set. This field value includes emails sent via the ListEmail object or Sales Engagement cadences.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 50.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 50.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- Description: Read-only. The total number of emails sent, including bounced, opted-out, and invalid To: addresses. To access this field, your org must use Sales Engagement and users need the Sales Engagement User or Sales Engagement Cadence Creator permission set. This field value includes emails sent via the ListEmail object or Sales Engagement cadences.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- Description: Read-only. The total number of times a recipient’s mail server acknowledged the email, but returned it to the sender. Sometimes it is because the recipient’s mailbox is full or the mail server is temporarily unavailable. A soft bounce message can sometimes be delivered at another time. After 5 soft bounces, Pardot opts the prospect out of emails. To access this field, your org must use Sales Engagement and users need the Sales Engagement User or Sales Engagement Cadence Creator permission set. This field value includes emails sent via the ListEmail object or Sales Engagement cadences.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 50.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 51.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 51.0
- Type: picklist
- Properties: Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
- Introduced: API version 35.0
- Description: Indicates the user interface where this template is usable.
- Possible values:
- Aloha — Aloha
- SFX — SFX
- SFX_Sample — SFX_Sample — SFXSample
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 50.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 50.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 50.0
To retrieve this object, issue a describe call on an object, which returns a query result for each activity since the object was created. You can’t query these records.
This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version.
- EmailTemplateChangeEvent: Introduced in API version 48.0.