Email Templates
These are the endpoints that are available under the /emailTemplates path, which lists all the different email templates on your business' account.
Endpoint | Description |
---|---|
GET /emailTemplates/emailCategory/{emailCategoryId} | Returns all email template objects within specified email category in array format. |
GET /emailTemplates/{emailTemplateId} | Returns a JSON object for specified email template. |
GET /emailTemplates/objectType/{objectType} | Returns all email template objects with specified objectType in array format. |
POST /emailTemplates | Creates a new email template object on an account. Request body/payload: Must pass an email template object in request body/payload. For these calls, you need to pass an email template object with all required fields and any fields you want to set or update filled in the body of the payload. We have an example of a email template object in the responses section below and have indicated the required fields in the object values table at the bottom of this page. |
POST /emailTemplates/{emailTemplateId}/merged | Returns specified email template object to display to the user to edit before sending to selected clients. Request body: Must pass an email template object in request body/payload. For these calls, you need to pass an email template object with the businessId, emailTemplateId, parameterMap, and professionalId fields set in the body of the payload. We have an example of a email template object in the responses section below. |
PUT /emailTemplates/{emailTemplateId} | Updates an existing email template object. Request body/payload: Must pass an email template object in request body/payload. For these calls, you need to pass an email template object with all required fields and any fields you want to update filled in the body of the payload. We have an example of an email template object in the responses section below and have indicated the required fields in the object values table at the bottom of this page. |
DELETE /emailTemplates/{emailTemplateId} | Removes an email template object from view by setting its active property to false. |
Data points passed on in the request URL portion of the API call that are used to filter the data being requested.
Parameter | Type | Endpoints to be used with | Description |
---|---|---|---|
staffId | integer | GET /emailTemplates/{emailTemplateId} | Should be set as the ID of any staff connected to email template objects to be returned following a GET call. |
reasonId | integer | GET /emailTemplates/{emailTemplateId} | Should be set as the ID of any reason connected to email template objects to be returned following a GET call. |
The objects below represent the minimum viable objects to pass that are needed to create or update an emailTemplates object. Check whether or not a property can be written to by looking at the Object Values table below to see if the property is writable.
Property Name | Type | Required | Description |
---|---|---|---|
active | boolean | Yes | Indicates whether or not the specified email template should return on GET calls. |
allowOnline | boolean | Indicates whether or not the specified email template is allowed online. | |
attachFileLibraryUUids | array | Displays as an array of unique alphanumeric fileLibraryUUids of any files attached to the specified email template. | |
bccAddress | string | Displays as the Bcc field of the specified email template. | |
businessId | integer | Yes | Provides unique numeric ID for the business to which the specified email template belongs. |
ccAddress | string | Displays as the CC field of the specified email template. | |
createdDate | integer | Displays as the date the specified email template was created in milliseconds elapsed since January 1, 1970 00:00:00 UTC form. | |
createdUser | string | Displays the username of user who created the specified email template. | |
emailBecause | string | Displays as the reason why the specified email template is being sent. | |
emailBody | string | Yes | Displays as the body of the specified email template. |
emailBodyText | string | Displays as the text of the body of the specified email template. | |
emailCategory | object | Yes | Displays the email category object that the specified email template falls within - for more info, see Email Categories API page. |
emailTemplateId | integer | Yes, on PUT calls | Provides unique numeric ID for the specified email template. |
externalName | string | Displays as the external name of the specified email template. | |
fromAddress | string | Displays as the From Address of the specified email template. | |
fromName | string | Displays as the From Name of the specified email template. | |
language | string | Displays as an abbreviation of the language used in the specified email template. | |
level | integer | Yes | Displays as the level of the specified email template. More information on the different levels and what they signify can be found on the Messaging page. |
modifiedDate | integer | Displays as date the specified email template was last modified in milliseconds elapsed since January 1, 1970 00:00:00 UTC form. | |
modifiedUser | string | Displays the username of user who last modified the specified email template. | |
noHeader | boolean | Indicates whether or not the specified email template has a header. | |
reasonIdList | integer | Displays as the IDs of any reasons connected to the specified email template. | |
reasonNameList | string | Displays as the names of any reasons connected to the specified email template. | |
replyToAddress | string | Displays as the Reply to Address of the specified email template. | |
resellerId | integer | Provides unique numeric ID for reseller of the specified email template. | |
s3FileName | string | Displays as the location/name of the specified email template file as stored in Amazon Web Services repository. This value cannot be overwritten with any PUT or POST calls. | |
sortOrder | integer | Affects the order in which the different email templates on the account appear. | |
subject | string | Displays as the Subject of the specified email template. | |
templateName | string | Displays as Template Name of the specified email template. | |
toAddress | string | Yes | Displays as the To address of the specified email template. |
toName | string | Displays as the To name of the specified email template. |