The template library
Open Mail → Templates. The library lists every template with its status and category.
The library also shows how often each template was sent recently and which flows send it, so you can see what would be affected before you change or delete one.
Statuses
Create a template
- Mail → Templates → New template.
- Start from Blank or from a prebuilt design:
- Give it a name. The name is how code and flows send it, so choose something stable such as
order-confirmation(letters, digits, dashes and underscores).
order.number, order.items), each with a sample, so the preview looks real straight away.
Design it
The editor is visual. Type/ anywhere, or use Insert, to add a block:
Select any block to style it. Select a block and choose Save as a reusable block to use it in other templates.
Above the body:
- Subject: what the inbox shows first. It can contain values:
Your order {{ order.number }} has shipped. - Preheader: the line most inboxes show after the subject. Use it; otherwise the inbox shows the first words of the body.
Bring an existing design
Import HTML pastes in a design you already have. Choose Convert to editable blocks to edit it in the editor, or keep it as HTML.Plain text
Every email should have a plain-text version: some people and some mail clients read only that, and spam filters look for it. Studio keeps one beside the design.Values
The Values tab lists what the template reads when it is sent, each with a description and a sample:
Samples fill the preview and test sends. Your code or flow passes the real values when it sends. For a list or object, write the sample as JSON.
Three values are always available from Settings → App details, so you never pass them yourself:
The full syntax (conditions, loops, filters, escaping) is on Template language.
Check, preview and test
- Preview shows the email exactly as it will be sent, with your sample values.
- Checks flag problems before you publish. Nothing to fix means you’re good. They look for:
- Send a test email sends it to your address with the sample values. The subject starts with [Test] so you can tell it apart.
Details
The template’s details panel holds:Publish
Drafts are never sent. Choose Publish this template, optionally with a note about what changed (“New footer, clearer button”). From that moment everything that sends this template (your code, flows and sign-in) uses the new version. Sending a template that has never been published fails with has not been published yet.Versions
Each publish keeps a version, with its note, who published it and when. Open Versions to read any of them. Restore puts an older version back as the draft; publish it to send it again. Nothing changes for senders until you publish.Rename, duplicate, archive and delete
- Rename keeps the template’s versions. Code and flows that send it by the old name will fail until you update them. The library shows which flows send it.
- Duplicate makes a copy with a new name, to start a variation.
- Archive hides a template you no longer use but might want back.
- Delete removes it and its versions. Anything still sending it will fail.
Templates in other environments
Templates are definitions, so promote copies them between environments, and infrastructure as code can define them in your repository.Good practice
- Name templates for what they are (
order-confirmation), not when you made them. - Give every value a sample so tests show real-looking output.
- Send yourself a test and open it on a phone before publishing.
- Write a note on every publish, so the version history tells a story.
- Keep transactional and marketing templates apart using categories, so you can find and review them easily.