> ## Documentation Index
> Fetch the complete documentation index at: https://loops.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Personalizing emails

> Add context and personalization to emails.

Every email you send from Loops can contain dynamic content connected to the contact you're sending to or the event that triggered the email.

A common example of using dynamic content is to personalize an email greeting by using a contact's first name, or by including a customer's plan details in a subscription reminder.

## Types of dynamic content

The three [email types](/types-of-emails) in Loops have different dynamic content available to them:

* **Campaign emails** can contain **contact properties**.
* **Workflow emails** can contain **contact properties** and **event properties**.
* **Transactional emails** can contain **data variables**.

The three types of dynamic content are:

* **Contact properties** are pieces of data related to each [contact](/contacts/properties) in your audience. There are a set of default properties like name and source, but you can also add any number of custom contact properties. If you sync contact data to Loops with the API, an integration or with CSV uploads, you can include that data in your email.
* **Event properties** are pieces of data that can be sent along with every [event](/events) (which are used to trigger workflow emails) via integrations or API calls.
* **Data variables** are pieces of data included in [transactional emails](/transactional), which are populated in the API call. You can utilize [optional data variables](/transactional#optional-data-variables) to make your transactional emails more dynamic.

## Add dynamic content to emails

<Warning>
  If you want to add dynamic content to a [custom MJML
  email](/creating-emails/uploading-custom-email), check the [Dynamic tag
  syntax](#dynamic-tag-syntax) section below.
</Warning>

To add dynamic content to your emails, type "\{" anywhere in the editor or click the `{}` dynamic content icon in the email editor toolbar. Using either of these options will open the dynamic content menu, a filterable list of all available properties you can insert.

<Tip>
  To add dynamic content to button text, you need to manually type the tag syntax directly into the button's URL field. See [Dynamic tag syntax](#dynamic-tag-syntax) below.
</Tip>

<img src="https://mintcdn.com/loops/EgyPhKkeXp9wCnWY/images/brace-menu.png?fit=max&auto=format&n=EgyPhKkeXp9wCnWY&q=85&s=27c73e902ab6b876bc16065bd09134aa" alt="Dynamic content menu appearing after typing the opening brace" width="2280" height="1532" data-path="images/brace-menu.png" />

<img src="https://mintcdn.com/loops/aOtgyczWtTw7x5Xz/images/basic-merge.png?fit=max&auto=format&n=aOtgyczWtTw7x5Xz&q=85&s=3ac2113a5d3c56b6419059f1ae4857f0" alt="Adding a contact property" width="2280" height="1035" data-path="images/basic-merge.png" />

These two options are also available in all of the sending setting fields above the editor. An icon appears on the right when you hover over each field, or you can start typing "\{".

<img src="https://mintcdn.com/loops/aOtgyczWtTw7x5Xz/images/sending-setting-dynamic.png?fit=max&auto=format&n=aOtgyczWtTw7x5Xz&q=85&s=f68fa2b5e396f1e4c8d911502f1507f5" alt="Adding a contact property to sending details" width="2280" height="782" data-path="images/sending-setting-dynamic.png" />

Depending on whether you're editing a campaign, workflow or transactional email, the menu shows different content based on your email type (explained above).

To use the dynamic content menu

1. Type `{` or hit the `{}` icon in any editor field
2. Continue typing to filter results: `{fir` shows "firstName"
3. Use `↑/↓` to navigate, `Enter` to select, `Escape` to close

When the email is sent, the dynamic content will be replaced with actual values from the contact, event or data variable.

Once you've selected something from the menu in a campaign or workflow email, you will be prompted to enter a fallback value. This ensures emails still send even when data is missing.

<Tip>
  If you send an email and the dynamic content is missing a value, the email
  will not be sent. Make sure to add fallback values to avoid missed sends.
  [Read more below](#fallback-values).
</Tip>

## Fallback values

Fallback values are important for campaign and workflow emails. If a contact doesn't have a value for a property, or an event property is missing, the email won't send.

When you insert a contact or event property using the dynamic content menu, you'll be prompted to enter a fallback. This default text ensures your email still sends even when data is missing.

<img src="https://mintcdn.com/loops/EgyPhKkeXp9wCnWY/images/brace-menu-fallback.png?fit=max&auto=format&n=EgyPhKkeXp9wCnWY&q=85&s=14a23c9ea6f430b1403f18ed8cc3d2d8" alt="Fallback input appearing after selecting a property" width="2280" height="1022" data-path="images/brace-menu-fallback.png" />

Common fallback examples:

| Example                    | Fallback     | Result                  |
| :------------------------- | :----------- | :---------------------- |
| Hey `{firstName}`          | there        | Hey there               |
| Welcome to `{companyName}` | your company | Welcome to your company |

This keeps your emails feeling personalized even when specific data isn't available.

Your fallback is saved and will auto-fill if you insert the same property again.

You can edit the fallback value later on from the editor panel.

<img src="https://mintcdn.com/loops/I7MiNuGd9K5dwTEQ/images/fallback-variable.png?fit=max&auto=format&n=I7MiNuGd9K5dwTEQ&q=85&s=4b91e6489b2078ab1781baad90f79aac" alt="Setting a fallback value for a dynamic field" width="2280" height="1206" data-path="images/fallback-variable.png" />

## Data variables in transactional emails

In transactional emails, dynamic tags work slightly differently: you can create new data variables in your email as you type.

<img src="https://mintcdn.com/loops/EgyPhKkeXp9wCnWY/images/brace-menu-variables.png?fit=max&auto=format&n=EgyPhKkeXp9wCnWY&q=85&s=88c2687bfef5c47a5aee0a27a5a15e97" alt="Creating a new data variable with the dynamic content menu" width="2280" height="1217" data-path="images/brace-menu-variables.png" />

1. Type `{orderTotal` (using a new name that doesn't exist).
2. Select **Create "orderTotal"** from the menu or press `Enter`.
3. The variable is created and you can edit it from the editor panel (change the name or change to an [optional variable](/transactional#optional-data-variables)).

## Dynamic tag syntax

As well as using the dynamic content menu, you can write dynamic content "tags" directly in the email body. This is especially useful when [uploading custom emails](/creating-emails/uploading-custom-email).

These tags are the only way to add dynamic content in [custom MJML emails](/creating-emails/uploading-custom-email), and to add dynamic content to button text in the editor.

### Contact properties

If you have a custom contact property named `teamName` that you want to add to a campaign, you can write it surrounded by curly brackets in the email:

```
{teamName}
```

When the email is sent, the `teamName` value for each contact will be added to the email.

<img src="https://mintcdn.com/loops/W7EWSDUW0GR-XWrp/images/merge-tag-0.png?fit=max&auto=format&n=W7EWSDUW0GR-XWrp&q=85&s=1362c358de9832b19a7d84d9ba1db93a" alt="Example merge tag inserted in an email" width="2280" height="830" data-path="images/merge-tag-0.png" />

For a list of all of your contact properties, visit the [API Settings](https://app.loops.so/settings?page=api) page. The **API Name** is the name you use within the brackets in your email, for example `{firstName}`, `{lastName}`, `{email}`, etc.

<img src="https://mintcdn.com/loops/W7EWSDUW0GR-XWrp/images/merge-tag.png?fit=max&auto=format&n=W7EWSDUW0GR-XWrp&q=85&s=c0581243e45c04d5f31d488bdee17632" alt="Contact properties table" width="2280" height="1661" data-path="images/merge-tag.png" />

### Event properties

To add dynamic data to workflow emails using event properties, the tag requires an `EVENT_PROPERTY:` prefix:

```
{EVENT_PROPERTY:firstName}
```

### Data variables

To add data variables in transactional emails, the tag requires a `DATA_VARIABLE:` prefix:

```
{DATA_VARIABLE:firstName}
```

<Tip>
  It is important to use the right names in your tags. Use the camelCase “API
  Name” from [API settings](https://app.loops.so/settings?page=api) for contact
  properties and event property names from the [Events
  settings](https://app.loops.so/settings?page=events) page. If you have any
  questions about how to format your tags, reach out to us!
</Tip>
