Email Template Object

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.

Supported Operations 

OperationHTTP VerbURL FormatAbility Requirements
CreatePOSThttps://pi.pardot.com/api/v5/objects/email-templates?<params>Marketing > Emails > Email Templates > Create ability
ReadGEThttps://pi.pardot.com/api/v5/objects/email-templates/<id>?<params>Marketing > Emails > Email Templates > View ability
UpdatePATCHhttps://pi.pardot.com/api/v5/objects/email-templates/<id>?<params>Marketing > Emails > Email Templates > Create ability
DeleteDELETEhttps://pi.pardot.com/api/v5/objects/email-templates/<id>Marketing > Emails > Email Templates > Delete ability
QueryGEThttps://pi.pardot.com/api/v5/objects/email-templates?<params>Marketing > Emails > Email Templates > View ability
Add TagPOSThttps://pi.pardot.com/api/v5/objects/email-templates/<id>/do/addTagMarketing > Emails > Email Templates > Create AND Marketing > Segmentation > Tags > Create ability
Remove TagPOSThttps://pi.pardot.com/api/v5/objects/email-templates/<id>/do/removeTagMarketing > Emails > Email Templates > Create AND Marketing > Segmentation > Tags > Create ability

Fields 

Required Editable Fields 

FieldTypeDescription
nameStringName of the email template.
subjectStringSubject line for the email template.
isOneToOneEmailBooleanIf True, the template is available for one-to-one emails.
isAutoResponderEmailBooleanIf True, the template is available for autoresponder emails.
isDripEmailBooleanIf True, the template is available for Engagement Programs.
isListEmailBooleanIf True, the template is available for list emails.
textMessageStringThe text content of the template’s message. This field isn’t queryable.
htmlMessageStringThe HTML content of the template’s message. This field isn’t queryable.
senderOptionsSender Options[]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)
trackerDomainIdIntegerThe ID of the tracker domain associated with this object.
folderIdIntegerID of the folder containing this object.
typeEnumThe content type of the email. Possible values are html (Read and Query only), text, and htmlAndText.
campaignIdIntegerThe ID of the campaign associated with this object.

Optional Editable Fields 

FieldTypeDescription
replyToOptionsReply To Options[]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 

FieldTypeDescription
idIntegerID of the email template.
isDeletedBooleanTrue if the object is in the recycle bin in Account Engagement.
createdAtDatetimeTime the email template was created; reported in API user’s timezone.
updatedAtDatetimeTime the email template last updated; reported in API user’s timezone.
createdByIdIntegerID of the user who created this object.
updatedByIdIntegerID of the user who last updated this object.
createdByUserUser object representing the user who created this object. See documentation for User for fields.
updatedByUserUser object representing the user who last updated this object. See documentation for User for fields.
campaignCampaignCampaign object representing the campaign that was set on Create. See documentation for Campaign for fields.
folderFolderJSON object representing the folder for this object. See documentation for Folder for fields.
trackerDomainTracker DomainTracker Domain object representing the tracker domain associated with the email template. See documentation for Tracker Domain for fields.
tagReplacementLanguageEnumMerge language of the email template. Can be "pml", "hml", or "undetermined".

senderOptions Fields 

Field NameData TypeDescription
senderOptions.typeEnumThe 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.addressStringThe sending email address.
senderOptions.nameStringThe name of the sender.
senderOptions.userIdIntegerThe user ID of the sender.
senderOptions.prospectCustomFieldIdIntegerThe ID of the prospect custom field that contains the sender value. Only available on read and query.
senderOptions.accountCustomFieldIdIntegerThe ID of the account custom field that contains the sender value. Only available on read and query.

replyToOptions Fields 

Field NameData TypeDescription
replyToOptions.typeEnumThe 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.addressStringThe reply-to email address.
replyToOptions.userIdIntegerThe user ID of the reply to sender.
replyToOptions.prospectCustomFieldIdIntegerThe ID of the prospect custom field that contains the reply to value.
replyToOptions.accountCustomFieldIdIntegerThe 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.

Note

Example Request

1POST /api/v5/objects/email-templates?fields=id,name,htmlMessage,textMessage,isOneToOneEmail,isDeleted,isAutoResponderEmail,isDripEmail,isListEmail,subject,type,createdAt,updatedAt,createdById,updatedById,trackerDomainId,campaignId,folderId HTTP/1.1
2Host: pi.pardot.com
3Pardot-Business-Unit-Id: <business-unit-id>
4Authorization: Bearer <access-token>
5
6{
7    "name": "New Email Template",
8    "subject": "Greetings",
9    "type": "htmlAndText",
10    "htmlMessage": "<html><head></head><body>hello, goodbye. %%unsubscribe%%</body></html>",
11    "textMessage": "hello, %%unsubscribe%%",
12    "campaignId" : 1001,
13    "folderId" : 500,
14    "isAutoResponderEmail" : false,
15    "isDripEmail" : false,
16    "isListEmail" : true,
17    "isOneToOneEmail" : false,
18    "senderOptions" : [
19        {
20            "type" : "account_owner"
21        },
22        {
23            "type" : "general_user",
24            "name" : "Marketing Team",
25            "address" : "test@example.com"
26        },
27        {
28            "type" : "specific_user",
29            "userId" : 10000
30        }
31    ],
32    "replyToOptions" : [
33        {
34            "type" : "specific_user",
35            "userId" : 10000
36        },
37        {
38            "type" : "general_address",
39            "address" : "test@test.com"
40        }
41    ]
42}

A successful request returns an HTTP 201 response. The response lists the fields that were specified in the request.

Email Template Read 

Retrieve a single email template following the conventions described in the Version 5 Overview.

Example Request

1GET /api/v5/objects/email-templates/20587?fields=id,name,textMessage,isOneToOneEmail,isDeleted,isAutoResponderEmail,isDripEmail,isListEmail,subject,type,updatedAt,createdById,updatedById
2Host: pi.pardot.com
3Pardot-Business-Unit-Id: <business-unit-id>
4Authorization: Bearer <access-token>

Example Response

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": 2479182
16}

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.

Note

Example Request

1PATCH /api/v5/objects/email-templates/:100?fields=id,name,htmlMessage,textMessage,isOneToOneEmail,isDeleted,isAutoResponderEmail,isDripEmail,isListEmail,subject,type,createdAt,updatedAt,createdById,updatedById,trackerDomainId,campaignId,folderId
2Host: pi.pardot.com
3Pardot-Business-Unit-Id: <business-unit-id>
4Authorization: Bearer <access-token>
5
6{
7    "name": "Updated Email Template",
8    "subject": "Updated Greetings",
9    "type": "htmlAndText",
10    "htmlMessage": "<html><head></head><body>Updated Text %%unsubscribe%%</body></html>",
11    "textMessage": "hello, %%unsubscribe%%",
12    "campaignId" : 1001,
13    "folderId" : 500,
14    "isAutoResponderEmail" : false,
15    "isDripEmail" : false,
16    "isListEmail" : true,
17    "isOneToOneEmail" : false,
18    "senderOptions" : [
19        {
20            "type" : "account_owner"
21        },
22        {
23            "type" : "general_user",
24            "name" : "Updated User Name",
25            "address" : "test@example.com"
26        },
27        {
28            "type" : "specific_user",
29            "userId" : 10000
30        }
31    ],
32    "replyToOptions" : [
33        {
34            "type" : "specific_user",
35            "userId" : 10000
36        },
37        {
38            "type" : "general_address",
39            "address" : "test@test.com"
40        }
41    ]
42}

Example Response

Responds with 200 OK and returns any fields specified in the request.

Email Template Delete 

Deletes an email template following the conventions described in the Version 5 Overview.

Example Request

1DELETE /api/v5/objects/email-templates/65231
2Pardot-Business-Unit-Id: <business-unit-id>
3Authorization: Bearer <access-token>

Example Response

Returns code 204 no content.

Email Template Query 

Retrieve a collection of email templates following the conventions described in the Version 5 Overview.

Example Request

1GET /api/v5/objects/email-templates?fields=id,name,isOneToOneEmail,isAutoResponderEmail,isDripEmail,isListEmail
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3"values": [
4        {
5            "id": 20583,
6            "isAutoResponderEmail": true,
7            "isDripEmail": true,
8            "isListEmail": true,
9            "isOneToOneEmail": false,
10            "name": "Blog Post Highlights"
11        },
12        {
13            "id": 20585,
14            "isAutoResponderEmail": true,
15            "isDripEmail": true,
16            "isListEmail": true,
17            "isOneToOneEmail": true,
18            "name": "Client Case Study"
19        },
20        {
21            "id": 20587,
22            "isAutoResponderEmail": true,
23            "isDripEmail": true,
24            "isListEmail": true,
25            "isOneToOneEmail": false,
26            "name": "Competitive Landscape"
27        }
28]

Sortable Fields 

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.

ParameterDescription
idID of the email template.
createdAtTime the email template was created; reported in API user’s timezone.
updatedAtTime 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.

ParameterDescription
idReturns any email templates where ID is equal to the given integer value.
idListReturns any email templates where ID is included in the given list of values.
idGreaterThanReturns any email templates where ID is greater than the specified value, non-inclusive.
idGreaterThanOrEqualToReturns any email templates where ID is greater than or equal to the specified value.
idLessThanReturns any email templates where ID is less than the specified value, non-inclusive.
idLessThanOrEqualToReturns any email templates where ID is less than or equal to the specified value.
nameReturns any email templates where Name is equal to the given string value.
createdAtReturns any email templates where CreatedAt is equal to the given datetime value.
createdAtAfterReturns any email templates where CreatedAt is after the given datetime value, non-inclusive.
createdAtAfterOrEqualToReturns any email templates where CreatedAt is after or equal to the given datetime value.
createdAtBeforeReturns any email templates where CreatedAt is before the given datetime value, non-inclusive.
createdAtBeforeOrEqualToReturns any email templates where CreatedAt is before or equal to the given datetime value.
updatedAtReturns any email templates where UpdatedAt is equal to the given datetime value.
updatedAtAfterReturns any email templates where UpdatedAt is after the given datetime value, non-inclusive.
updatedAtAfterOrEqualToReturns any email templates where UpdatedAt is after or equal to the given datetime value.
updatedAtBeforeReturns any email templates where UpdatedAt is before the given datetime value, non-inclusive.
updatedAtBeforeOrEqualToReturns any email templates where UpdatedAt is before or equal to the given datetime value.
deletedDetermines whether to return deleted records. The value can be false (default), true, or all.
isOneToOneIf True, the template is available for one-to-one emails.

Add Tag 

Adds a Tag to the Email Template object, which creates a TaggedObject.

Example Request

1POST https://pi.pardot.com/api/v5/objects/email-templates/1000/do/addTag
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "tagId": 100
8}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 610,
5    "createdAt": "2024-09-23T18:26:49-04:00",
6    "createdById": 250,
7    "objectId": 1000,
8    "objectType": "email-template",
9    "tagId": 100
10}

Remove Tag 

Remove a tag from an Email Template object. When you remove a tag, the associated TaggedObject record is deleted.

Example Request

1POST `https://pi.pardot.com/api/v5/objects/email-templates/1000/do/removeTag`
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "tagId": 100
8}

Example Response

Returns code 204 no content.