Skip to main content
Store an email body once and send it by id or slug. Merge variables fill in the per-recipient details, so your copy lives on the platform — editable without a deploy — instead of buried in your code. A template bundles a subject and an html and/or text body. Anywhere you write {{variable}}, the rendering engine substitutes a value from the data object you pass at send time. Templates are scoped to the sending project and addressable by their auto-generated id or a human-friendly slug.

Create a template

POST /v1/templates Give it a name, a subject, and a body. An optional slug gives you a stable handle like welcome to reference in code; omit it and one is generated from the name. The response includes a variables array — every {{token}} the engine found across the subject and bodies.

Merge variables

Variables use double-brace {{handlebars}} syntax and can appear in the subject, the HTML, and the text part. At send (or render) time, pass a data object whose keys match the token names:
  • Subject: "Welcome to {{company}}, {{firstName}}" + data: { company: "Acme", firstName: "Ada" }"Welcome to Acme, Ada".
  • A token with no matching key renders empty and is reported in the missing array when you render or preview — so you can catch gaps before sending.
Values are escaped for HTML. Merge values are safe-rendered into the HTML body, so user-supplied data can’t inject markup. Author the layout in the template; pass only data through data.

Render and preview

Two endpoints render without sending — wire them into a live editor or a test before you ship copy. POST /v1/templates/{id}/render Render a saved template by id or slug with a data object. Returns the resolved { subject, html, text, missing }.
Render a saved template
Render response
POST /v1/templates/preview Preview an unsaved draft — pass the subject/html/text inline along with data. Ideal for a template editor that re-renders on every keystroke without persisting anything.
Preview a draft

Send by templateId

POST /v1/emails To send a stored template, set templateId (id or slug) on a normal send and supply the merge values in data. The engine resolves the subject and body server-side.
templateId and inline bodies don’t mix. A send carries either a templateId or inline html/text — not both. Combining them is a validation_error. To override just the subject, pass subject alongside templateId; it is rendered with data and wins over the template’s subject.
GET /v1/templates/gallery The gallery is a set of curated starter templates — welcome emails, receipts, password resets, and the like — each with a category, a ready-made body, and sampleData. Use one as the starting point for a create call instead of authoring from a blank page.
Browse the gallery

Fields

string
required
A human label for the template.
string
required
The subject line. May contain {{variables}}.
string
The HTML body with optional merge variables. Provide html, text, or both.
string
The plain-text body / alternative part.
string
A stable, URL-safe handle to reference the template in code. Generated from name when omitted.
object
At render/send time: the merge values keyed by variable name.

Next

Send email

The send fields a templateId plugs into.

Batch & scheduled

Reuse one template across a batch of recipients.

Create template API

The full POST /v1/templates contract.

Contacts

Pull merge data from your address book.