Concepts
Templates
Versioned, parameterised message bodies.
A template is a reusable message body with named variables. They are project-scoped, versioned, and rendered server-side at send time.
Why templates
- Edit copy without redeploying. Marketing changes a subject line, the next send uses the new version.
- Localisation. A single
welcome_emailtemplate can carry anen,es,devariant; the send picks the locale. - Auditability. Every send records the template id + version that rendered it.
Variables
Templates use Handlebars-style placeholders:
Subject: Welcome to {{product_name}}, {{first_name}}!
Hi {{first_name}},
Thanks for joining. Your dashboard is at {{dashboard_url}}.At send time, POST /v1/email/send:
{
"to": "maya@example.com",
"template": "tpl_8c4e2a1f",
"data": {
"product_name": "Acme",
"first_name": "Maya",
"dashboard_url": "https://app.acme.dev/dashboard"
}
}Every template field is rendered, not just the body — subject included, so a
dynamic subject line is a variable inside the template rather than a field on
the request. A variable missing from data renders as an empty string; it does
not fail the send. See Template syntax.
Versioning
Each save creates a new version. The active version is the one rendered by default; older versions remain queryable by id. Roll back by re-activating a prior version, no template id changes, no client code changes.