Custom templates
#customA custom template is an HTML body (with an optional plain-text fallback) that you create and store. Reference it by its slug.
| Field | Required | Notes |
|---|---|---|
name | ✅ | Label shown in the UI. |
slug | ✅ | Stable identifier used by templateSlug. Lowercase letters, numbers, hyphens. |
subject | ✅ | May contain Handlebars placeholders. |
htmlBody | ✅ | The HTML body with Handlebars placeholders. |
textBody | — | Optional plain-text fallback. |
domainId | — | Optionally scope the template to a domain. |
Variables
#variablesInsert values with double curly braces, then pass them via variables on /v1/send:
{{name}} placeholder.Loops & conditionals
#logicCustom templates render with Handlebars, so the full block syntax is available:
variables accepts nested objects and arrays, so the example above works with:
Built-in helpers ({{#unless}}, {{#with}}, …) are all available.
Styling
#stylingCustom templates use inline CSS — write styles directly in the HTML body. This is the standard approach for HTML email and the most reliable across email clients:
There is no separate theme system for custom templates — themeId on /v1/send only applies to built-in React Email layouts. For reusable styling, you have a few options:
Style variables
Pass colours and fonts as template variables:
Theme object with {{#with}}
Pass a nested theme object and scope into it:
Base layout in the template
Put your wrapper HTML (header, footer, brand styles) directly in each template body. Since templates are stored per-slug, you can copy-paste a consistent base layout across templates.
Built-in layouts
#layoutsEmailFlare seeds 50 system templates — one per React Email layout — on first run. Their HTML body is empty because the layout is the content. Reference them by slug exactly like custom templates:
Themes
Layout templates support colour themes via themeId. Switch per send — no CSS edits needed.
defaultoceanforestvioletslatethemeId only applies to layout templates. Custom HTML templates ignore it — you control styling directly in the body.Managing templates
#managingCreate and edit templates from the Templates page in the admin UI — the live preview highlights resolved variables inline. Or use the admin API (session-authenticated /api/templates):
Create example:
Sending with a template
#sendingSend by slug (preferred) or by id:
subjecton the send payload overrides the template subject.variablesare applied to both the subject and the body.- At least one of
templateSlug,templateId,html, ortextmust be present. - Test keys (
eftest_) capture the rendered email into the Test Mailbox — verify without burning real delivery.