Create custom variables
Each Template may contain up to 20 variables. To add a custom variable, select Variable in the commands palette or type{{ in the editor. Define the name, type, and fallback_value (optional).

You can also define custom variables via the API. The payload can optionally include variables to be used in the Template.
The following variable names are reserved and cannot be used:
FIRST_NAME,
LAST_NAME, EMAIL, UNSUBSCRIBE_URL, contact,this.key: The key of the variable. We recommend capitalizing the key. (e.g.PRODUCT_NAME).type: The type of the variable ('string'or'number').fallback_value: The fallback value of the variable. If no fallback value is provided, you must provide a value for the variable when sending an email using the template.
Fallback values
When you define a variable, you can optionally define a fallback value. This value will be used when sending the email if you fail to provide a value in your call. In the editor, if you fail to provide a fallback value, a warning sign will show for the variable, which you can remove by providing a value. As shown above, you can also include fallback values when creating a Template via the API.Send Test Emails
You can send test emails to your inbox to preview your Template before sending it to your audience. Provide variable values to test the rendered Template in your inbox.Send a Template with Variables
When sending a transactional email, you can reference your Template and include your variables in the call. The Template variables will be replaced with the actual values.id: id of the published templatevariables: array of variable objects (if applicable)
/emails and /emails/batch endpoints support Templates.
If a
template is provided, you cannot send html, text, or react in the payload, otherwise the API will return a validation error.When sending a template, the payload for from, subject, and reply_to take precedence over the template’s defaults for these fields. If the template does not provide a default value for these fields, you must provide them in the payload.