Overview
This request allows you to create a transactional template by specifying details such as the name subject line, HTML content, and enabling engagement reporting.
Endpoint
| Method | URL |
|---|---|
| POST | https://api.everlytic.net/transactional/email/v1/templates |
Request Body
| Property | Description | Data type | Parameters | Required |
|---|---|---|---|---|
| name | The name of the template | string | Yes | |
| subject | The subject line text that will appear in recipients’ inboxes. | string | Yes | |
| description | A short description of the template | string | No | |
| from_email | The email address that will appear as the sender in recipients’ inboxes | string | Must be a verified domain | Yes |
| from_name | The name that will appear as the sender in recipients’ inboxes | string | No | |
| reply_email | The email address that replies to emails using this template will go to. | string | Yes | |
| content_html | The HTML body content of the template | string | Yes | |
| content_text | The text body content of the template | string | No | |
| track_reads | Setting to enable engagement reporting when contacts’ open emails using this template | boolean |
|
No |
| track_links | Setting to enable engagement reporting when contacts’ click on links in emails using this template | boolean |
|
No |
| group_by_name | Emails sent using this template will be grouped under this name, instead of the default behaviour of grouping by month. | string | No |
Example Request
curl --location 'https://api.everlytic.net/transactional/email/v1/templates' \ --data-raw ''
Response
Status codes
| Status code | Explanation |
|---|---|
| 200 OK | Template was created successfully |
| 400 Bad Request | The request body was improperly formatted |
| 401 Unauthorized | The provided authorization credentials are incorrect |
| 403 Forbidden | This user does not have access to Transactional Emails |
| 412 Precondition Failed | One or more of the properties in the request body were invalid |
Properties
Properties of responses with status 200
| Property | Sub-properties | Description | Data type | Parameters |
|---|---|---|---|---|
| template | id | The ID that will be used to identify the webhook in future requests | string | |
| name | The template’s name | string | ||
| subject | The subject line text on the template | string | ||
| description | A short description of the template | string | ||
| from_email | The email address that will be shown as the sender in the contact’s inbox | string | Verified domain | |
| from_name | The name assigned that will appear as the sender in the contact’s inbox | string | ||
| reply_email | The email address that will receives replies to emails using this template | string | ||
| track_links | This determines whether engagement on links will be recorded on emails using this template | boolean |
|
|
| track_clicks | This determines whether engagement on clicks will be recorded on emails using this template | boolean |
|
|
| group_by_name | Emails sent using this template will be grouped under this name, instead of the default behaviour of grouping by month. | string | ||
| content_html | The HTML body content of the template | string | ||
| content_text | The text body content of the template | string | ||
| status | The current publication status of the template | enum (string) |
|
|
| created_timestamp | The initial date and time that the template was created | date-time | ISO 8601 date-time string | |
| updated_timestamp | The latest date and time that the template was updated | date-time | ISO 8601 date-time string |
Properties of responses with 4XX status
| Property | Description | Data type | Expected parameters |
|---|---|---|---|
| code | The HTTP response status code | integer |
|
| message | The reason for the failure | string | Valid string |
| error | Array containing errors field | JSON |
|
| errors | Array containing the failure details | JSON |
|
| domain | The classification of the type of error | string |
|
| reason | Keyword used to describe the error | string |
|
| message | Text describing the reason for the failure | string | Valid string |
| locationType | The location where the failure occurred | string |
|
| location | The type of validation that failed | string |
|
Example responses
Successful created a template [200 OK]
Invalid from email format [412 Precondition Failed]
Invalid/Missing authorization credentials [401 Unauthorized]