Building email templates
The drag-and-drop template editor — how a template is stored as two blobs, importing existing HTML, exporting, previewing, and the two ways a template can end up silently empty.
A template is the body of an email. Campaigns do not carry content of their own — they carry a subject line and a pointer to a template — so the template is where all the design work happens, and one template can back any number of campaigns.
Templates live at Admin → MailWizard → Templates, /admin/mailwizard/template.
A template is two things at once
Every template row stores two separate payloads, and the difference between them explains most of the behaviour on this screen:
| Field | What it is | Who reads it |
|---|---|---|
content |
The finished, exported HTML | The send job. This is exactly what lands in the recipient's inbox |
design |
The editor's own JSON description of the layout | The drag-and-drop editor, when you reopen the template |
They are written together every time you save from the editor, and they can drift
apart if you edit the HTML by any other route. The one that matters at send time
is content. If you edit the design outside the editor and forget to re-export,
the campaign sends the old HTML.
Creating a template
-
Templates → Create — the page opens the full-screen visual editor with a blank canvas and a name field above it.
-
Name it before you design — the Save button stays disabled until the name field has something in it, which is easy to miss after twenty minutes of layout work.
-
Build the email — drag rows in from the left panel, drop content into them, set colours and spacing on the right. If you have saved blocks, they appear in the editor's Blocks panel; see Reusable blocks.
-
Save — the editor exports the HTML and the design together and posts both. You land back on the Templates list.
Creating with no design at all is allowed on purpose — it gives you a placeholder
to point a campaign at while somebody else does the artwork. An empty template
stores {} in both fields, which is not the same as broken, but it is not
sendable either.
Editing a template
Opening a template from the list puts you back in the same full-screen editor, with the stored design loaded.
The toolbar carries five things:
- Preview — exports the current HTML and opens it in a new tab, rendered as a standalone document. This is the closest thing the product has to an inbox preview; there is no multi-client rendering test.
- Save as block — captures one row (or the whole design) as a reusable block.
- Export as HTML — downloads the exported HTML as a file. Useful for handing a design to somebody who wants to check it, or for archiving.
- Save — writes and stays in the editor.
- Save & Exit — writes and returns to the list.
An Unsaved badge appears next to the template name the moment you change anything, and the browser warns before you navigate away with changes pending.
The name field in the editor toolbar is editable and the editor posts it, but the
template update endpoint writes content and design only. A rename made here
is silently discarded on save — reopen the template and the old name is back.
There is no other rename path: create and import set the name, nothing changes
it.
Name templates properly the first time. If a name has to change, create a new template with the right name, paste the design in, and repoint the campaigns that use it.
Importing HTML you already have
There is an import endpoint that takes a name, a body and a design in one call:
All three fields are required — importing a template without a body is meaningless, and the endpoint refuses it with a message naming the missing field rather than a database error.
The design field has to be the editor's own JSON. If you import raw HTML and
put something else in design, the template sends perfectly well and opens as a
blank canvas in the editor — the design the editor tries to load is not one
it can read.
The Templates list marks this for you. A row whose design parses shows an Editable design badge; one whose design does not shows HTML only. Treat an HTML-only template as read-only: any edit means re-importing the whole thing.
Inspecting a template without opening the editor
The row's view dialog is faster than loading the editor and answers the two questions you usually have.
- Email preview renders the stored HTML in a sandboxed frame, exactly as it is stored. Nothing inside a template can run scripts in your admin panel.
- Layout lists each row of the design with its column count and the kinds of
content in it —
text,image,buttonand so on. - Rows, Content blocks and HTML size give you the shape at a glance. A template measured in hundreds of kilobytes is usually one with base64 images inlined, which is worth knowing before you send it to a thousand people.
- HTML source and Design JSON are there, collapsed, for when you need to read the raw payload.
Two badges are worth reacting to. HTML only means the design is unusable, as above. No content means the body is empty and every recipient of a campaign using it receives a blank email.
What a template cannot do
The send job hands your template's content straight to the mail transport. It
does not merge in the recipient's name, it does not resolve any placeholder, and
it does not wrap the email in the platform's notification layout.
Anything that looks like a merge tag — %FIRSTNAME%, {{name}}, [[email]] —
is delivered to the recipient as those literal characters.
Following from the same fact:
- No unsubscribe link is added. The platform's transactional emails get one injected by the notification templating; campaign email does not go through that path. If you need an opt-out, put a real link into the template yourself and process the replies manually.
- No plain-text alternative is generated. Campaign email is HTML-only, which some spam filters weigh against you.
- The subject line lives on the campaign, not the template. The same template can go out under different subjects.
Deleting a template
Deletion is soft — the row is retained with a deletedAt stamp — but the
association from campaigns to templates cascades. A campaign whose template has
gone is skipped by the send job with "Template not found" in the cron log, and
editing that campaign fails with a 404 until you pick a different template.
Before deleting, check the Campaigns list: the Template column links each campaign to the template it uses, so it is quick to see who depends on what.
Practical notes
The editor's image tools will happily inline an image, which pushes the template past a hundred kilobytes and gets clipped by several mail clients. Upload images to your own site and reference them by absolute URL instead. Every recipient fetches the same file, so it also gives you the only crude open signal you will get from this product — your web server's access log.
The preview and the stored HTML are rendered against a light canvas regardless of your admin theme, because that is what the email was authored against. A design that only reads correctly in dark mode will not survive the trip.
There is no versioning and no history. Editing a template changes what every
future campaign using it will send — including a campaign that is already
ACTIVE and half-way through its recipient list, since the send job re-reads the
template on every run. If you need to change an email mid-send, duplicate the
template instead and repoint a new campaign at it.
Next: Reusable blocks for sections you want in every email, or Building and sending a campaign to put a template to work.