Docs/Merchants/Campaigns & Messaging
Preview and test an email template
Every email template page has an Email Preview card that shows the email body as you type. You can add sample values for your placeholders so the preview reads like a real email, then send the template to a customer of your choice as a test. Nothing you do in the preview changes the template itself or what your customers receive.
Open the Email Preview card
- In the Toki app, click Workflows in the left navigation.
- Open a workflow and select its Send Email action, or add one.
- Under Email Template, click View all templates, then open a template or click New template. To jump straight into a template, use Create new template or Edit selected instead.
- On the template page, scroll below the Email Editor card to Email Preview.
For the fields on the template page itself, see Email templates.
The live preview
The Email Preview card renders whatever is in HTML Body right now, including changes you haven't saved yet. Edit the body and the preview updates as you go. While the body is empty, the card shows "No content to preview".
The preview shows the body of the email. To check the subject line too, send a test email.
Preview variables
Placeholders such as {{customer.name}} or {{customer.email}} stay empty in the preview until you give them a value. Preview variables are those sample values. Toki fills your placeholders with them in the preview and, when you send a test, in the test email.
Add preview variables
-
In the Email Preview card, click Preview variables.
-
Type your sample values into the field. The empty field shows an example of the format:
{ "customer": { "email": "ada@example.com", "name": "Ada Lovelace" } }Each name in quotes matches a placeholder. Names inside a group use a dot in the placeholder, so
"name"inside"customer"fills{{customer.name}}. -
Click Format JSON to tidy the layout. It's a nicety, not a requirement.
-
Click anywhere outside the window to close it. The preview updates as you type.
| Element | What it does |
|---|---|
| Preview variables field | Sample values for your placeholders. Must be a list of names and values inside curly braces, as in the example. |
| Format JSON | Rearranges your values into a clean, indented layout. Available as soon as the field's contents are valid. |
| "Enter valid JSON" | Appears under the field when Toki can't read what you typed. Fix the text and the message goes away. |
Good to know
- Forgot the quotes around a name, or left a comma after the last value? Toki reads it anyway.
- A placeholder with no matching value comes out blank, in the preview and in a test email. If you spot a gap, add that value to your preview variables.
- Toki remembers your preview variables in this browser, separately for each template, so they're there the next time you open the template on the same computer. They are used only for previewing and testing. They never become part of the template and never reach your customers.
- Save a new template before you set up its preview variables. Toki files them under the saved template from then on.
Send a test email
A test email goes to a real customer in your store, using the Subject and HTML Body exactly as they are on the page right now, saved or not. Pick a customer record that uses your own email address to get the test in your inbox.
- In the Email Preview card, click Test.
- In the Send test email window, start typing an email address under Test customer and pick the customer from the list.
- Check the Preview variables shown in the window. They are the same values as in the card, so you can adjust them right before sending.
- Click Send test email.
Toki confirms with "Test email sent".
Send test email becomes available once you've picked a customer, filled in both Subject and HTML Body, and the preview variables are valid.
What the test email contains
| Part | Where the value comes from |
|---|---|
| Recipient | The email address on the customer record you picked. Choose a customer who has an email address on file. |
| Sender | The Sender Name and Sender Address in the Email Settings section of the Loyalty page. This is what your customers see too. |
| Subject and body | Your current Subject and HTML Body, with placeholders filled in. |
{{customer.email}} and {{customer.name}} | The picked customer's own details, unless you set a different value in Preview variables. Your preview variables always win. |
| Any other placeholder | Its value from Preview variables. A placeholder with no value comes out blank. |
Because your preview variables take priority, you can send a test to your own customer record and still see it addressed to "Ada", or to whatever sample values you set.
Related
- Email templates: create, edit, and activate the templates you preview here.
- Test a campaign: the equivalent test send for a campaign, across every channel.