Home
Back to docs
Email Templates

How do I use a variable in an email?

Insert a placeholder such as the customer's name or a code, and avoid the ways it silently disappears.

You will have put a piece of live information, such as a code or a name, into an email.

Before you start

You need the Manage permission. Look at the chips above the editor: they list the variables this template can use, plus siteName, which every template has.

Steps

  1. Click into the field where the information should appear (subject, preheader, or a block).
  2. Click the variable's chip. It inserts {{name}} into that field.
  3. In a rich-text block, the chip is added at the end of the text; move it into place by cutting and pasting.
  4. Check the preview, which fills each variable with a sample value.
  5. Press Save.

What you will see

In the real email the variable is replaced by the actual value, such as the order number.

If something goes wrong

  • A misspelled or unavailable variable becomes empty text, with no error and nothing shown. If words vanish in the preview, check the spelling against the chips.
  • Nothing stops you deleting a required variable, such as {{code}} in the sign-in-code email. People would then get an email without the code; always compare with the preview.
  • Write it exactly with double braces and no extra characters: {{code}}.
  • Keep variables unchanged when you translate an email.

Last updated: