# Merge tags

A merge tag is a placeholder in double braces, such as `{{contact.firstName}}`, that is
filled in for each person when the message is sent. Merge tags work in email subjects and
bodies, WhatsApp and LinkedIn text, AI prompts, campaigns and individual emails.

## Where to find it

In any editor: type `{{` or click **Insert variable**. The picker lists every tag you can
use, with a search box (**Search variables…**).

## Before you start

- The contact fields you want to use, filled in for your contacts in the CRM.

## Add a merge tag

1. Put the cursor where the value should go, and click **Insert variable**.
2. Pick the field.
3. Optionally type a **Default value (optional)** — used when the field is empty for a
   contact.
4. Pick a contact in the preview to check the result.

## The tags

| Tag | Becomes |
|---|---|
| `{{contact.firstName}}`, `{{contact.lastName}}`, `{{contact.email}}`, `{{contact.companyName}}` | The contact's field |
| `{{contact.<field>}}` | Any custom field of the contact |
| `{{contact.json}}` | All the contact's fields at once — handy in an AI prompt |
| `{{account.name}}`, `{{project.name}}` | Your account's name, the project's name |
| `{{step.prev.sentBody}}`, `{{step.2.sentSubject}}` … | An earlier email step in the same workflow — see below |
| `{{unsubscribe}}` | The contact's own unsubscribe link |
| `{{shortlink:https://…}}` | In WhatsApp, the address as the contact's own tracked short link |

## Fallbacks

Add a value after a bar to use when the field is empty:
`{{contact.firstName | there}}` gives "Hi there" for a contact with no first name.

## Earlier email steps

A later email step can quote an earlier one. Pick a step by its number (the **Step N**
badge on its card), `prev` for the one just before, or `chain` for all before. The picker
offers each part, for example the authored subject or prompt, **Actual sent subject**,
**Actual sent body**, and **Everything (full block)**. Useful in an AI prompt: "write a
follow-up to `{{step.prev.sentBody}}`".

## The unsubscribe tag

- Put `{{unsubscribe}}` in your own HTML where your unsubscribe link should be; then
  TurboWorkflow adds no footer of its own. Without it, a small footer with the link is
  added.
- `{{unsubscribe_url}}` and `{{unsubscribe_link}}` work too.
- Unsubscribe links are never click-tracked, so the link always works.

## Good to know

- An unknown tag becomes empty. The start dialog lists contacts missing a value the
  email needs, so you can fill them in or remove the tag.
- A tag inside a link's query (`?email={{contact.email}}`) is encoded so the address
  arrives intact.
- In a campaign, `{{unsubscribe}}` opens the [subscription page](/marketing/subscription-categories)
  for that category.

## Related

- [AI personalisation](/email/ai-personalisation) · [Email step](/steps/email-step)
- [Guide: Write and personalize an email](https://turboworkflow.com/help/write-an-email)

<section aria-labelledby="faq" class="faq">

## FAQ

<details>
<summary>How do I add a merge tag?</summary>

Type `{{` or click **Insert variable** in any editor and pick the field.

</details>
<details>
<summary>What if a contact's field is empty?</summary>

Add a fallback after a bar, for example `{{contact.firstName | there}}`. An unknown tag becomes empty.

</details>
<details>
<summary>How do I place the unsubscribe link myself?</summary>

Put `{{unsubscribe}}` in your HTML; TurboWorkflow then adds no footer of its own.

</details>

</section>
