{ "sections": [ "title", "description", "fields", "special_access_rules", "usage", "associated_objects", "wsdl_segment", "field_reference" ], "title": "EmailTemplate - Data API", "description": "Represents a template for an email, mass email, list email, or Sales Engagement email. Supported in first-generation managed packages only.", "fields_columns": [ "type", "properties", "description", "relationship_name", "relationship_type", "refers_to" ], "fields": { "ApiVersion": { "type": "double", "properties": "Create, Filter, Nillable, Sort, Update", "description": "The API version for this class. Every class has an API version specified at creation." }, "Body": { "type": "textarea", "properties": "Create, Nillable, Update", "description": "Content of the email. Limit: 384 KB." }, "BrandTemplateId": { "type": "reference", "properties": "Create, Filter, Group, Nillable, Sort, Update", "description": "ID of the BrandTemplate associated with this email template. The brand template supplies letterhead information for the email template.", "required": true }, "DeliveryRate": { "type": "percent", "properties": "Filter, Nillable, Sort", "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. This field is available in API version 46.0 and later. 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." }, "Description": { "type": "string", "properties": "Create, Filter, Nillable, Sort, Update", "description": "Description of the template, for example, Promotion Mass Mailing." }, "DeveloperName": { "type": "string", "properties": "Create, Defaulted on create, Filter, Group, Sort, Update", "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. Note: When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance may slow while Salesforce generates one for each record." }, "Encoding": { "type": "picklist", "properties": "Create, Filter, Group, Nillable, Restricted picklist, Sort, Update", "description": "Character set encoding for the template." }, "EnhancedLetterheadId": { "type": "reference", "properties": "Create, Filter, Group, Nillable, Sort, Update", "description": "ID of the enhanced letterhead associated with the email template. Note: To use an enhanced letterhead, associate it with a Lightning email template that uses the HML merge language. This is a relationship field.", "relationship_name": "EnhancedLetterhead", "relationship_type": "Lookup", "refers_to": "EnhancedLetterhead" }, "EntityType": { "type": "picklist", "properties": "Create, Filter, Group, Restricted picklist, Sort,", "description": "When UIType is 2 (Lightning Experience) or 3 (Lightning ExperienceSample), EntityType indicates which entities this template can be used with (for example, account or lead). Valid values are standard object ID prefixes: 001 for account, 003 for contact, 006 for opportunity, and 00Q for lead, 500 for case, and 701 for campaign. This field has been removed in API version 39.0. Use RelatedEntityType instead." }, "FolderId": { "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": "Lookup", "refers_to": "Folder, Organization, User" }, "FolderName": { "type": "string", "properties": "Filter, Nillable, Sort", "description": "The name of the folder that contains the template." }, "HasSalesforceFiles": { "type": "boolean", "properties": "Defaulted on create, Filter, Group, Sort", "description": "If the email template has attachments from Salesforce Files. The default value is false." }, "HtmlValue": { "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." }, "IsActive": { "type": "boolean", "properties": "Create, Defaulted on create, Filter, Group, Sort, Update", "description": "Indicates that this template is active if true, or inactive if false." }, "IsBuilderContent": { "type": "boolean", "properties": "Defaulted on create, Filter, Group, Sort", "description": "If the email template was made in Email Template Builder. The default value is false." }, "LastUsedDate": { "type": "dateTime", "properties": "Filter, Nillable, Sort", "description": "Date and time when this email template was last used. Used with Salesforce Classic templates. Not typically used with Lightning Experience templates." }, "Markup": { "type": "textarea", "properties": "Create, Nillable, Update", "description": "The Visualforce markup, HTML, JavaScript, or any other Web-enabled code that defines the content of the template." }, "Name": { "type": "string", "properties": "Create, Filter, Group, idLookup, Sort, Update", "description": "Name of the template. Label is Email Template Name." }, "NamespacePrefix": { "type": "string", "properties": "Filter, Group, Nillable, Sort", "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__componentName notation. The namespace prefix can have one of the following values. In Developer Edition orgs, NamespacePrefix is 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, NamespacePrefix is 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." }, "OwnerId": { "type": "reference", "properties": "Create, Defaulted on create, Filter, Group, Sort, Update", "description": "ID of the owner of the template. This is a relationship field.", "relationship_name": "Owner", "relationship_type": "Lookup", "refers_to": "User" }, "RelatedEntityType": { "type": "picklist", "properties": "Create, Filter, Group, Nillable, Restricted picklist, Sort, Update", "description": "When UIType is 2 (Lightning Experience) or 3 (Lightning ExperienceSample), RelatedEntityType indicates 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." }, "Subject": { "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." }, "TemplateStyle": { "type": "picklist", "properties": "Create, Filter, Group, Restricted picklist, Sort", "description": "Style of the template. Possible values are: formalLetter—Formal Letter freeForm—Free Form Letter newsletter—Newsletter none—No Email Layout products—Products promotionLeft—Promotion (Left) promotionRight—Promotion (Right)" }, "TemplateType": { "type": "picklist", "properties": "Create, Filter, Group, Restricted picklist, Sort", "description": "Type of template. Possible values are: custom—Custom html—HTML text—Text visualforce—Visualforce" }, "TimesUsed": { "type": "int", "properties": "Filter, Group, Nillable, Sort", "description": "Number of times this email template has been used. Used with Salesforce Classic templates. Not typically used with Lightning Experience templates." }, "TotalDelivered": { "type": "int", "properties": "Filter, Group, Nillable, Sort", "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. This field is available in API version 46.0 and later. 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." }, "TotalHardBounced": { "type": "int", "properties": "Defaulted on create, Filter, Group, Nillable, Sort", "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. This field is available in API version 46.0 and later. 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." }, "TotalOpens": { "type": "int", "properties": "Defaulted on create, Filter, Group, Nillable, Sort", "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. This field is available in API version 46.0 and later. 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." }, "TotalSent": { "type": "int", "properties": "Filter, Group, Nillable, Sort", "description": "Read-only. The total number of emails sent, including bounced, opted-out, and invalid To: addresses. This field is available in API version 46.0 and later. 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." }, "TotalSoftBounced": { "type": "int", "properties": "Defaulted on create, Filter, Group, Nillable, Sort", "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. This field is available in API version 46.0 and later. 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." }, "UIType": { "type": "picklist", "properties": "Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update", "description": "Indicates the user interface where this template is usable. Possible values are: Aloha SFX SFX_Sample—SFXSample" } }, "special_access_rules": "Customer Portal users can’t access this object.", "usage": "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.", "associated_objects": "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 and later.\n\n- **EmailTemplateChangeEvent (API version 48.0)**: Change events are available for the object.", "wsdl_segment": "```xml\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n\n\n \n\n\n \n \n \n \n \n \n\n```", "field_reference": { "ApiVersion": { "field_label": "API Version", "type": "double", "precision": "18", "scale": "1" }, "Body": { "field_label": "Email Body", "type": "textarea", "length": "384000" }, "BrandTemplateId": { "field_label": "Letterhead ID", "type": "reference", "length": "18" }, "CreatedById": { "field_label": "Created By ID", "type": "reference", "length": "18" }, "CreatedDate": { "field_label": "Created Date", "type": "datetime" }, "DeliveryRate": { "field_label": "Delivery Rate", "type": "percent", "precision": "5", "scale": "2" }, "Description": { "field_label": "Description", "type": "string", "length": "4000" }, "DeveloperName": { "field_label": "Template Unique Name", "type": "string", "length": "80" }, "Encoding": { "field_label": "Encoding", "type": "picklist", "length": "40" }, "EnhancedLetterheadId": { "field_label": "Enhanced Letterhead ID", "type": "reference", "length": "18" }, "FolderId": { "field_label": "Folder ID", "type": "reference", "length": "18" }, "FolderName": { "field_label": "Folder Name", "type": "string", "length": "256" }, "HtmlValue": { "field_label": "HTML Value", "type": "textarea", "length": "384000" }, "Id": { "field_label": "Email Template ID", "type": "id", "length": "18" }, "IsActive": { "field_label": "Available For Use", "type": "boolean" }, "IsBuilderContent": { "field_label": "Made in Email Template Builder", "type": "boolean" }, "LastModifiedById": { "field_label": "Last Modified By ID", "type": "reference", "length": "18" }, "LastModifiedDate": { "field_label": "Last Modified Date", "type": "datetime" }, "LastUsedDate": { "field_label": "Last Used Date", "type": "datetime" }, "Markup": { "field_label": "Markup", "type": "textarea", "length": "1048576" }, "Name": { "field_label": "Email Template Name", "type": "string", "length": "80" }, "NamespacePrefix": { "field_label": "Namespace Prefix", "type": "string", "length": "15" }, "OwnerId": { "field_label": "Owner ID", "type": "reference", "length": "18" }, "RelatedEntityType": { "field_label": "Custom Object Definition ID", "type": "picklist", "length": "40" }, "Subject": { "field_label": "Subject", "type": "string", "length": "1000" }, "SystemModstamp": { "field_label": "System Modstamp", "type": "datetime" }, "TemplateStyle": { "field_label": "Style", "type": "picklist", "length": "40" }, "TemplateType": { "field_label": "Template Type", "type": "picklist", "length": "40" }, "TimesUsed": { "field_label": "Times Used", "type": "int", "digits": "9" }, "TotalDelivered": { "field_label": "Total Delivered", "type": "int", "digits": "9" }, "TotalHardBounced": { "field_label": "Total Hard Bounces", "type": "int", "digits": "9" }, "TotalOpens": { "field_label": "Total Opens", "type": "int", "digits": "9" }, "TotalOutOfOffice": { "field_label": "Total Out Of Office", "type": "int", "digits": "9" }, "TotalReplies": { "field_label": "Total Replies", "type": "int", "digits": "9" }, "TotalSent": { "field_label": "Total Sent", "type": "int", "digits": "9" }, "TotalSoftBounced": { "field_label": "Total Soft Bounces", "type": "int", "digits": "9" }, "TotalTrackedLinkClicks": { "field_label": "Total Tracked Link Clicks", "type": "int", "digits": "9" }, "TotalTrackedSent": { "field_label": "Total Tracked Sent", "type": "int", "digits": "9" }, "TotalUntrackedSent": { "field_label": "Total Untracked Sent", "type": "int", "digits": "9" }, "UiType": { "field_label": "UI Type", "type": "picklist", "length": "40" }, "UniqueOpens": { "field_label": "Unique Opens", "type": "int", "digits": "9" }, "UniqueReplies": { "field_label": "Unique Replies", "type": "int", "digits": "9" }, "UniqueTrackedLinkClicks": { "field_label": "Unique Tracked Link Clicks", "type": "int", "digits": "9" } }, "field_reference_columns": [ "field_label", "type", "precision", "scale", "length", "digits" ] }