Email templates
Every email is drawn from one of your templates. You write it once in the app, give it a handle, and the API sends it by that handle with your values filled in. Templates don't need anyone's approval.
You need a role that can manage templates: Owner, Admin, Member, or a custom role with Manage Email Templates.
Email › Templates starts with three you can change or delete: Welcome (welcome), Verification Code (verification-code) and Receipt (receipt).
Write the template
- Open Email › Templates and choose New Template.
- Give it a Name, such as
Order Shipped. The Handle is filled in from it, such asorder-shipped. Change it if you like. - Write the Subject, and if you want, the Preview Text most inboxes show after the subject.
- Build the content from Blocks, or paste your own HTML.
- Put
{{variables}}where your values go, such asYour order {{order_number}} is on its way. - Under Preview Values, give an example of each value. The preview and Send Test use them.
Choose Save Template.
Try it with Send Test
Choose Send Test, enter an address, and pick a sender. The template goes out as it is on screen, saved or not, with the preview values. A test is charged like any email, and shows in Email › History. You need a verified domain with a sender first.
Send it by its handle
Put the handle in template, and a value for each variable in values. See Sending email.
Handles
The handle is how the API names the template.
- Lowercase words joined by dashes, such as
verification-code, up to 64 characters. - Each handle is used by one template in your team.
- If you change a handle, requests that use the old one are refused with
404. Change your code first.
Variables
A variable is a name in double braces, such as {{first_name}}: letters, digits and underscores, starting with a letter. Use them in the subject, the preview text and the body.
- Every send gives a value for each variable the template uses. A request without one is refused with
Give a value for {{first_name}}., and nothing is charged. - Values are text, up to 1,000 characters each. They're put in as text, so HTML in a value shows as written.
{{brand_name}}is filled in with the Brand Name from your brand, so you never send it.
Blocks or HTML
| Blocks | HTML | |
|---|---|---|
| You write | Headings, text, buttons, codes, details rows, images and dividers, in order | Your own HTML |
| Your brand | The logo, colors and footer are added | Not added |
| Limit | 60 blocks | 500,000 characters |
Scripts and forms don't run in email. If you switch from blocks to HTML, your blocks are kept.
Your brand
Set your brand once under Email › Brand. Every blocks template uses it, so changing it changes them all at once.
| Section | What you set |
|---|---|
| Identity | The Brand Name, a Logo (PNG, JPG or GIF, under 1 MB), and a Header that's light or in your brand color |
| Colors and Type | The Brand Color for buttons, links and codes, the Background Color behind the email, and a sans serif or serif font |
| Footer | Your Address, Website and a Footer Note, such as why the reader got this email |
The brand needs a role that can manage email settings: Owner, Admin, or a custom role with Manage Email Settings.
Changing a template
- A change applies to the next send. Emails already sent keep what they said.
- To try a change without touching the template in use, choose Copy to New Template in its menu. The copy has its own handle.
- Deleting a template stops sends that use its handle: they're refused with
404.
A team can have up to 200 templates.