Using transactional templates
Browse the template catalog, clone any system template into your account, customize the copy, and send via the REST API with your branding auto-applied.
By SESMetric Docs
SESMetric ships a curated library of transactional email templates — auth flows, invoices, alerts, reminders, onboarding, generic. Browse them at /templates, clone any into your account, and send via the REST API.
1. Browse the catalog
The public catalog at /templates lists every system template, filterable by category:
| Category | Templates |
|---|---|
| auth | password reset, email verification, account activation, magic-link sign-in, password changed, 2FA code |
| billing | invoice issued, paid, payment failed, due-soon, overdue, refund processed |
| notification | system alert, incident, quota warning, security alert, new comment, new mention |
| reminder | task due soon, task overdue, appointment, follow-up, trial ending soon |
| onboarding | welcome, getting started, setup incomplete, trial ended |
| generic | blank, simple text, single-CTA |
Click any template to preview the rendered HTML, see its variables, and (when signed in on a paid plan) clone it into your account.
2. Clone a template
Click Clone to my account on any template detail page. The system template is copied — slug intact — into your /dashboard/templates list. From there you can edit subject, copy, body, and variables freely.
3. Send with a template
Pass the slug in your /v1/send payload:
curl -X POST https://api.sesmetric.com/v1/send \
-H "Authorization: Bearer $SM_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_email": "no-reply@example.com",
"to": ["alex@customer.com"],
"template": "password-reset",
"variables": {
"user": { "first_name": "Alex" },
"reset_url": "https://app.example.com/reset?token=abc123"
}
}'
Variables are rendered with Jinja2. The template resolver checks your user-owned templates first; if no match, it falls back to the system template of the same slug.
4. Branding is auto-injected
Every template references {{ branding.* }} for logo, primary color, footer copy, button radius, and brand name. These come from your settings at /dashboard/branding and are merged into every render with no extra arguments.
<a class="btn" href="{{ reset_url }}"
style="background:{{ branding.primary_color }};
border-radius:{{ branding.button_radius }}px">
Reset password
</a>
If a branding field is unset, sensible defaults apply (signal green, 8 px radius, no footer).
5. Authoring custom templates
For a one-off template not in the catalog:
- Go to
/dashboard/templates→ New (or clone the closest match and start from there). - Write the subject + HTML body in Jinja2. Use the live preview tab to spot-check.
- Declare expected variables in the Variables panel so future you (and any AI agent calling
/v1/send) knows what to pass. - Set
status = publishedand the template becomes sendable.
6. Jinja2 cheat sheet
{{ user.first_name }} # variable
{{ amount | default("$0.00") }} # filter
{% if items %}...{% endif %} # condition
{% for it in items %}{{ it.title }}{% endfor %}
{# this is a comment #}