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

# Variables

# Working with Variables & Merge Tags

Personalize your email templates with dynamic variables and merge tags.

***

## Variable Syntax

Mailofly uses double curly braces for variables:

```html theme={null}
<h1>Hello, {{first_name}}!</h1>
<p>Your subscription to {{plan_name}} will renew on {{renewal_date}}.</p>
```

***

## Fallback Values (Default Content)

To prevent empty spaces when a variable is not provided for a specific contact, specify a fallback using the pipe `|` syntax:

```html theme={null}
<p>Hey {{first_name | there}},</p>
```

* If `first_name` is `"Sarah"`, it renders: `Hey Sarah,`
* If `first_name` is missing or `null`, it renders: `Hey there,`

***

## Reserved System Variables

Mailofly automatically injects the following system merge tags into every send:

| Variable                | Description                                     |
| :---------------------- | :---------------------------------------------- |
| `{{email}}`             | The recipient's email address.                  |
| `{{unsubscribe_url}}`   | Unique URL for one-click unsubscribe.           |
| `{{current_year}}`      | Four-digit current calendar year (e.g. `2026`). |
| `{{organization_name}}` | The name of your Mailofly organization.         |

***

## Nested Objects and Arrays

You can access nested fields inside structured objects:

```html theme={null}
<p>Ship to: {{order.shipping_address.city}}, {{order.shipping_address.country}}</p>
```

And in your API request:

```json theme={null}
{
  "order": {
    "shipping_address": {
      "city": "San Francisco",
      "country": "USA"
    }
  }
}
```


## Related topics

- [Template Variables](/templates/template-variables.md)
- [MCP Server](/mcp-server/introduction.md)
- [Email types](/getting-started/email-types.md)
- [AI onboarding](/getting-started/ai-onboarding.md)
- [Create Template](/api/templates/create-template.md)
