Dynamic templates
Create a dynamic template
URL
/dynamic_templates
Method
POST
- Replace
<template_path>
with the path to the handlebars (.hbs) template file you'd like to upload - Replace
<template_name>
with the name you wish to call your template - Replace
<USERNAME>
with your API endpoint username and<API_KEY>
with your API key.
Update a dynamic template
URL
/dynamic_templates
Method
PATCH
- Replace
<template_path>
with the path to the handlebars (.hbs) template file you'd like to upload - Replace
<template_name
> with the name you wish to call your template - Replace
<USERNAME>
with your API endpoint username and<API_KEY>
with your API key. - Replace
<id>
with the id of the template you wish to update
Delete a dynamic template
URL
/dynamic_templates
Method
DELETE
- Replace
<template_path>
with the path to the handlebars (.hbs) template file you'd like to upload - Replace
<template_name>
with the name you wish to call your template - Replace
<USERNAME>
with your API endpoint username and<API_KEY>
with your API key. - Replace
<id>
with the id of the template you wish to update
View all your org's dynamic templates
URL
/dynamic_templates
Method
GET
- Replace
<USERNAME>
with your API endpoint username and<API_KEY>
with your API key.
View one of your org's dynamic templates
URL
/dynamic_templates
Method
GET
- Replace
<USERNAME>
with your API endpoint username and<API_KEY>
with your API key. - Replace
<id>
with your template's ID
Send a dynamically templated message
Sending a dynamically templated email is exactly the same as sending a normal API email, apart from the fact that we're hitting a different endpoint, and we're substituting the values template_name
and template_values` for the message content (the content field is omitted from the message field)
URL
/templated_messages
Method
POST
- Replace
<USERNAME>
with your API endpoint username and<API_KEY>
with your API key. - Replace
<template_name>
with the name of the template you created in the 'create template' section. - Replace
<template_values>
with the values you'd like to populate in your template, JSON-formatted
Data parameters
Example JSON request body
Attachment content should be Base64 encoded. An attachment contentType value should be a valid MIME type.
Success response
Code: 200 Content:
The sourceTrackingId
can be used with the messages api to track any dynamically templated email (templated mails are sent as normal messages, and are tracked as such)
Error response
Code: 400 Bad Request` Content: