Help

Personalise emails with merge fields and fallbacks

A merge field puts a detail about the person into the email when it is sent: {{ first_name }} becomes “Maya”. Add a fallback for people whose detail is missing: {{ first_name | "friend" }} becomes “friend” when there is no first name. Merge fields work in the subject, in text and in links.

Last updated

Insert one

  1. Click a text block, or open Email settings for the subject.
  2. Put the cursor where the detail should go.
  3. Choose a field from Insert a field… under the text box, or type it yourself between double braces.

In the editor, a merge field shows as a label, such as “First name, or “friend””. The real value appears in a test send and in the sent email.

Fields you can use

Merge fieldBecomes
{{ first_name }}The contact’s first name
{{ last_name }}The contact’s last name
{{ email }}The contact’s email address
{{ workspace.name }}Your brand name
{{ workspace.postal_address }}Your postal address from Settings, Sending
{{ event.order_number }}The order number, in an email a flow sends after an order
{{ event.discount_code }}The person’s own discount code, in a flow email that hands one out
{{ country }}Any custom field, by its name

event. fields come from what started a flow, such as the order or the cart, so they are empty in a campaign. Use a fallback with them.

Fallbacks

Write the fallback after a bar: {{ first_name | "friend" }}. Single quotes and no quotes also work: {{ first_name | there }}. Without a fallback, a missing detail becomes nothing, so “Hi {{ first_name }},” would read “Hi ,”.

A campaign is refused when its subject would come out empty for someone whose details are missing, which happens when the subject is only a merge field with no fallback.

Questions

Yes, for example https://yourshop.com/cart?email={{ email }} or {{ event.cart_url }} in a cart reminder. Values in a link are made safe for web addresses.

Can a merge field add HTML or formatting?

No. Whatever a contact’s field holds is shown as plain text.

All help topics · API reference