> ## 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.

# Template Variables

> Using dynamic merge tags, conditional logic, and loops in templates.

# Template Variables

Mailofly templates use standard Liquid templating syntax for dynamic personalization.

## Dynamic Merge Tags

Insert recipient or transaction properties using double curly braces:

```html theme={null}
<p>Hello {{ user.first_name | default: "there" }},</p>
<p>Your order #{{ order.id }} has shipped!</p>
```

## Conditionals and Loops

```html theme={null}
{% if order.is_gift %}
  <p>Gift message: {{ order.gift_note }}</p>
{% endif %}

<ul>
{% for item in order.items %}
  <li>{{ item.name }} - ${{ item.price }}</li>
{% endfor %}
</ul>
```


## Related topics

- [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)
- [Introduction](/templates/introduction.md)
