Templates
The mail every app sends, ready to go.
50 built-in layouts for sign-in, security, billing and product notices, in five colour themes. Or write your own in Handlebars. Send either one by slug.
Built-in layouts
50 layouts, rendered for real.
Every thumbnail below is the HTML the Worker produces for that layout with sample values. Pick a theme, filter by category and open one to see its variables.
Showing 50 of 50 layouts
The built-in layouts share one structure, so they differ in the fields they show and the words around them, not in their design. They are read-only. If you want a specific look, write a custom template.
Two kinds
Built-in layouts and your own templates.
You send both the same way. A slug in the request is all it takes.
Handlebars guide
The syntax, with real output.
Each result below was produced by the same renderer your Worker runs, when this page was built.
Variables
Put a value in double braces. Pass the values in variables when you send. The same variables fill the subject line.
<p>Hi {{name}},</p>
<p>Order <strong>{{orderId}}</strong> is on its way.</p>{
"name": "Alex",
"orderId": "ORD-1042"
}Result
<p>Hi Alex,</p> <p>Order <strong>ORD-1042</strong> is on its way.</p>
Nested values
Reach into objects with dots. variables can hold objects as well as strings and numbers.
{{plan.name}} plan, renews {{plan.renewsOn}}{
"plan": {
"name": "Pro",
"renewsOn": "Dec 1"
}
}Result
Pro plan, renews Dec 1
Conditionals
Show a block only when a value is set, with an optional else. unless does the reverse. Empty strings, empty lists, zero and false count as not set.
{{#if trialDays}}
Your trial ends in {{trialDays}} days.
{{else}}
Thanks for being a customer.
{{/if}}{
"trialDays": 3
}Result
Your trial ends in 3 days.
Missing values
A variable you do not send renders as nothing. It never shows as {{code}} to your customer, but it can leave a gap, so check the output in the playground.
Hi {{name}}, your code is {{code}}.{
"name": "Alex"
}Result
Hi Alex, your code is .
Repeated rows
Build lists in your own code and pass the finished markup. The template inserts it as written.
<ul>{{items}}</ul>{
"items": "<li>Widget</li><li>Gadget</li>"
}Result
<ul><li>Widget</li><li>Gadget</li></ul>
Styling
Use inline CSS, which is the most reliable across mail clients. Pass colours and fonts as variables to reuse one template across brands.
<h1 style="color: {{brandColor}};
font-family: {{font}};">
Hello {{name}}
</h1>{
"name": "Alex",
"brandColor": "#f97316",
"font": "Arial, sans-serif"
}Result
<h1 style="color: #f97316;
font-family: Arial, sans-serif;">
Hello Alex
</h1>Themes
Five colour themes for the built-in layouts.
Set themeId on the request. The theme changes the accent, background and text colours, and nothing else.
Default
themeId: "default"
Ocean
themeId: "ocean"
Forest
themeId: "forest"
Violet
themeId: "violet"
Slate
themeId: "slate"
In your code
Send by slug. Pass the variables.
No template engine in your app and no HTML in your repository. Change the email in the dashboard and the next send uses it.
subjectin the request overrides the template subjectvariablesfill the subject and, for custom templates, the body- A test key renders the template into the test mailbox without delivering it
curl -X POST https://your-emailflare.workers.dev/v1/send \
-H "Authorization: Bearer eflive_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"from": "hello@yourdomain.com",
"to": "alex@example.com",
"templateSlug": "welcome",
"themeId": "ocean",
"variables": {
"name": "Alex",
"appName": "Acme",
"loginUrl": "https://app.acme.dev/login"
}
}'In the dashboard
Search, preview and write templates.
The Templates page lists every layout and custom template. Open one to preview it with sample variables and a theme, or create a new template.
- Search by name, slug or subject
- Preview built-in layouts in any theme
- Create custom templates with a subject, HTML and plain-text body
- Test a send from the playground before you ship

FAQ
Template questions.
Stop hard-coding email in your app.
Deploy EmailFlare, pick a layout and send it by slug. Your templates and your mail stay in your own account.
