Editing Email Templates
Write your own versions of PayNow's emails in MJML and Liquid, preview them with example data, and set them active.
Email templates are written in MJML, a markup language that compiles to email-safe HTML, with Liquid for the values that change per email: the customer's name, what they bought, your store's details.
Dashboard → Marketing → Emails → Open Email Editor. Needs email_settings_update; making a template live needs email_template_activate.
The editor opens in a new tab. It works like a code editor in the browser, but there are no files on your computer: everything you see lives in PayNow, and saving sends it straight there. The editor's PayNow Help panel has the same reference in more depth.
How templates are organised
| In the editor | What it is |
|---|---|
| A folder, e.g. Order Completed | One email type: an event PayNow sends an email for. |
default.mjml | PayNow's built-in version. Read-only. Customers get it when none of yours is active. |
Any other .mjml file | A template you wrote. A folder can hold as many as you like; only one is active at a time. |
| The Layout folder | The frame every other email is placed inside: header, footer, branding. |
The active template is locked read-only. To change what customers receive, edit a different template and activate that one.
Writing a template
- Open the folder for the email you want to change.
- Create a new
.mjmlfile in it, or open one of your inactive templates. Starting from the contents ofdefault.mjmlis the quickest way in. - Edit. The preview beside the file re-renders shortly after you stop typing, with example values.
- Save with
Ctrl+S. The template is saved to PayNow immediately; there's no separate publish step. - Click Send Test Email in the preview toolbar. It goes to the address on your PayNow account.
- Click Set Active when it's ready. You can also activate it from the template's page under Emails.
Saving is immediate and there is no version history. Activating doesn't validate the template either, so a broken one reaches customers as written. Keep your working copy in a separate inactive template, and only activate after the preview is clean and a test email looks right.
MJML basics
An email is sections, which hold columns, which hold content:
<mj-section>
<mj-column>
<mj-text font-size="20px" font-weight="700">Thanks for your order!</mj-text>
<mj-text>Your items are on their way to the server.</mj-text>
<mj-button href="https://example.com">Back to the store</mj-button>
</mj-column>
</mj-section>A whole email needs the <mjml><mj-body>…</mj-body></mjml> wrapper, but a template for any type other than Layout can leave it out: the layout supplies it, and your template is inserted into it. Common tags are <mj-text>, <mj-button>, <mj-image>, <mj-divider> and <mj-table>; the MJML documentation has the rest.
Variables
Each email type receives its own variables, such as customer, order and store. Click Variables in the preview toolbar for the full list for the template you're editing; it also marks which ones your template uses.
Hi {{ customer.name | default: "there" }},
your order {{ order.pretty_id }} is complete.
{% if order.lines.size > 1 %}
Here's everything you bought:
{% endif %}An undefined variable renders as nothing. Hello {{ custmer.name }}! quietly becomes Hello ! and ships that way. Copy names from the Variables panel rather than typing them, and give anything that might be missing a default:.
Every template also receives your branding:
| Variable | Holds |
|---|---|
store_logo_light | Your light-mode header image. Only set if you uploaded one. |
store_logo_dark | Your dark-mode header image. Only set if you uploaded one. |
color | Your accent colour. |
Components
Some emails offer ready-made blocks written as custom tags, such as <mj-order-table /> for the list of items in an order. PayNow swaps each one for the full block before the email is built. Each email type has its own set, so a component that works in one type may not exist in another; the type's default.mjml is the place to see them in use.
Components only work in one exact form:
| You write | Result |
|---|---|
<mj-order-table /> | Works. |
<mj-order-table></mj-order-table> | The closing tag is left behind as stray text. |
<mj-order-table style="…" /> | Not replaced. Attributes aren't supported, so the block disappears. |
<MJ-Order-Table /> | Not replaced. Tags are case-sensitive. |
A section that silently goes missing in the preview is almost always a misspelled component or variable.
Layouts
Every email except the layout itself is placed inside the active layout. Your template is rendered first, then passed to the layout as content, so a layout must include {{ content }}:
<mjml>
<mj-body>
{% if store_logo_light %}
<mj-image src="{{ store_logo_light }}" width="200px" />
{% endif %}
{{ content }}
</mj-body>
</mjml>A layout without {{ content }} sends every email with a header, a footer and no body.
To give one email its own block in a position the layout controls, such as a custom footer line, wrap it in a Liquid capture in the template:
{% capture content_footer %}
<mj-text>See you on the server!</mj-text>
{% endcapture %}The layout receives it as {{ content_footer }}. Templates that don't define it leave it empty, so a layout can use it safely.
Before you activate
- No red error panel in the preview. It means MJML or Liquid errors, and they would ship.
- No section has vanished. Check component tags and variable names.
- The layout still contains
{{ content }}. - Anything that might be missing has a
default:. - A test email looks right in Gmail, Outlook and a phone. The preview is close to real mail clients, but custom fonts, dark mode and blocked images can still differ.