Email template endpoints
The following endpoints and parameters can be used with email template:
Get a list of all email templates on this platform
Use the following endpoint to get a list of all email templates created in your platform. This method is paginated and defaults to the first page with 25 templates per page if the paging is not specified.
Endpoint | Purpose |
---|---|
GET {URI}/emailTemplates | Get a list of all Email Templates on this Platform. |
Here are a list of query parameters for when you use GET {URI}/emailTemplates
to get a list of all email templates on this Platform:
Parameter | Data type | Description |
---|---|---|
elementsPerBlock | int32 | specify the number of elements in a block. |
page | int32 | specify the page number to return. |
See the payload example below:
{
"page": {
"number": 0,
"elementsPerBlock": 0,
"resultCount": 0,
"totalCount": 0
},
"emailTemplates": [
{
"etid": "string",
"name": "string",
"fromName": "string",
"subject": "string",
"headerImage": "string",
"headerImageAltText": "string",
"accentColor": "string",
"messageBody": "string",
"closing": "string",
"customerServiceMessage": "string",
"accessControls": [
{
"type": "PLATFORM",
"identifier": "string"
}
],
"defaults": [
{
"type": "PLATFORM",
"identifier": "string"
}
]
}
]
}
The response message for this endpoint is:
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
Create a new email template
Use POST {URI}/emailTemplates
to create email templates for reward delivery. The ETID returned in the API response is necessary to identify a particular email template when ordering.
Endpoint | Purpose |
---|---|
POST {URI}/emailTemplates | Create a new email template. |
Here is the list of body parameters for when you use POST {URI}/emailTemplates
to create a new email template:
Parameter | Data type | Description |
---|---|---|
name | string | A unique name to give the template. |
fromName | string | The name that appears in the From line of the email. |
subject | string | The Subject of the email. |
headerImage | string | A Base64 encoded string of an image that shows as the header of the email. |
headerImageAltText | string | The Alt Text for the Header Image in the email. |
accentColor | string | A Hex color value, six hexadecimal digits preceded by a pound sign, used as an accent in the email. |
messageBody | string | The message body for the email. This is often used to let the recipient know why they have received the reward. |
closing | string | After the reward credential, a space to close the message to the recipient. |
customerServiceMessage | string | (Optional) If left null, Tango's Customer Support contact information is included. Otherwise contact information for your customer support, if you are taking responsibility for providing first tier customer support of your recipients. |
accessControl | array of objects | (Optional) Indicates which Customers and/or Accounts should have access to this template. |
-type | string | The type of access being specified: PLATFORM, CUSTOMER or ACCOUNT. |
-identifier | string | Leave this field blank if the type is PLATFORM. Enter either customerIdentifier or accountIdentifier (5-100 chars), if the type is CUSTOMER OR ACCOUNT, respectively. |
defaults | array of objects | If you want this template to be used at order time for the given Platform, Customer or Account when the Email Template Identifier (etid) is not provided with the order. |
-type | string | The type of default being specified: PLATFORM, CUSTOMER or ACCOUNT. |
-identifier | string | Leave this field blank if the type is PLATFORM. Enter either customerIdentifier or accountIdentifier (5-100 chars), if the type is CUSTOMER OR ACCOUNT, respectively. |
See the payload example below:
{
"etid": "string",
"name": "string",
"fromName": "string",
"subject": "string",
"headerImage": "string",
"headerImageAltText": "string",
"accentColor": "string",
"messageBody": "string",
"closing": "string",
"customerServiceMessage": "string",
"accessControls": [
{
"type": "PLATFORM",
"identifier": "string"
}
],
"defaults": [
{
"type": "PLATFORM",
"identifier": "string"
}
]
}
The response message for this endpoint is:
- 201 Created
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 409 Conflict, Duplicate Exists
- 422 Unprocessable Entity
Get details for a specific email template
Use the following endpoint to receive details pertaining to a specific email template on this platform.
Endpoint | Purpose |
---|---|
GET /{URI}/emailTemplates/{etid} | Get details for a specific Email Template on this Platform. |
Here is the path parameter for when you use GET /{URI}/emailTemplates/{etid}
to get details for a specific Email Template on this platform.:
Parameter | Data type | Description |
---|---|---|
etid | string | (Required) Email Template Identifier (ETID) is returned in the email template response payload. |
See the payload example below:
{
"etid": "string",
"name": "string",
"fromName": "string",
"subject": "string",
"headerImage": "string",
"headerImageAltText": "string",
"accentColor": "string",
"messageBody": "string",
"closing": "string",
"customerServiceMessage": "string",
"accessControls": [
{
"type": "PLATFORM",
"identifier": "string"
}
],
"defaults": [
{
"type": "PLATFORM",
"identifier": "string"
}
]
}
The response message for this endpoint is:
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
Update details for a specific email template
Use the following endpoint to update details for a specific email template on this platform. Only include elements that need to be updated.
Endpoint | Purpose |
---|---|
PATCH {URI}/emailTemplates/{etid} | Update details for a specific Email Template on this Platform. |
The following table shows parameters for PATCH {URI}/emailTemplates/{etid}
.
Parameter | Data type | Description |
---|---|---|
etid | string | (Required) Email Template Identifier (ETID) is returned in the email template response payload. (Path Parameter). |
name | string | (Optional) A unique name to give the template. |
fromName | string | (Optional) The name that will appear in the From line of the email. |
subject | string | (Optional) The Subject of the email. |
headerImage | string | (Optional) A Base64 encoded string of an image that will show as the header of the email. |
headerImageAltText | string | (Optional) The Alt Text for the Header Image in the email. |
accentColor | string | (Optional) A Hex color value, six hexadecimal digits preceded by a pound sign, used as an accent in the email. |
messageBody | string | (Optional) The message body for the email. This is often used to let the recipient know why they have received the reward. The string may have up to 1024 characters. |
closing | string | (Optional) After the reward credential, a space to close the message to the recipient. |
customerServiceMessage | string | (Optional) If left null, Tango's Customer Support contact information will be included. Otherwise contact information for your customer support, if you are taking responsibility for providing first tier customer support of your recipients. |
accessControl | array of objects | (Optional) Which Customers and/or Accounts should have access to this template. |
defaults | array of objects | (Optional) If you want this template to be used at order time for the given Platform, Customer or Account when the Email Template Identifier (ETID) is not provided with the order. |
See the example payload below:
{
"etid": "string",
"name": "string",
"fromName": "string",
"subject": "string",
"headerImage": "string",
"headerImageAltText": "string",
"accentColor": "string",
"messageBody": "string",
"closing": "string",
"customerServiceMessage": "string",
"accessControls": [
{
"type": "PLATFORM",
"identifier": "string"
}
],
"defaults": [
{
"type": "PLATFORM",
"identifier": "string"
}
]
}
The response message for this endpoint is:
- 200 Ok
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 409 Conflict, Duplicate Exists
Delete a specific email template
Note:
You cannot delete an email template that has been used to send rewards.
Use the following endpoint to delete an existing email template.
Endpoint | Purpose |
---|---|
DELETE {URI}/emailTemplates/{etid} | Delete a specific Email Template on this Platform. |
Here is a path parameter for when you use DELETE {URI}/emailTemplates/{etid}
to delete a specific email template on your platform.
Path parameter | Data type | Description |
---|---|---|
etid | string | Email Template Identifier (ETID) is returned in the email template response payload. |
The response message for this endpoint is:
- 204 No Content
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
Updated about 2 months ago