# Templates and variables

> The specification of Reply message templates and personalization variables — the contact, team, custom, advanced, and AI variable types with their syntax, Spintax randomization, template folders and sharing, and the HTML-editor rules for images, fonts, and hyperlinked custom fields.

**Variables are placeholders in double curly braces that personalize email, LinkedIn, SMS, WhatsApp, and Call step content per contact. Reply supports basic contact, team, custom, advanced (fallback, conditional, date), and AI variables, plus Spintax randomization. Templates live in Personal, Team, and Library folders and can be shared; sequences can be saved as templates.**

_Status: Reviewed — human-edited, facts not yet confirmed against the product._

## At a glance

| Aspect | Detail |
| --- | --- |
| **What it is** | The personalization layer of Reply messaging: reusable templates plus `{{ }}` variables resolved per contact when each message goes out |
| **Belongs to / Contains** | Variables are used in email, LinkedIn, SMS, and WhatsApp steps and in Call step notes; templates live in **Personal**, **Team**, and **Library** folders under Sequences → Templates |
| **Surfaces** | UI (template editor, sequence step editor, Chrome Extension task templates) |
| **Key limit** | An AI variable with live web search costs **1 Reply credit per variable per contact**; without live search it is free |
| **Lifecycle** | Template created → optionally shared to the Team folder → removed (still visible on the stats page until the sequence is removed or archived) |
| **Does not** | Show AI variable output on the Preview page (it is generated just before sending), allow variables inside a Spintax block, or accept spaces in variable names |
| **Sharing** | Templates can be shared in both Team Edition Private and Public modes; saved AI prompts stay private to your account |

## Definition

Variables are placeholders you use in email, LinkedIn, SMS, and WhatsApp templates, as
well as in Call steps, to automatically pull data from your contacts and team. Instead of
typing each recipient's name, you write `{{FirstName}}` or `{{Company}}` and Reply fills
in the right value for every contact. Templates are saved message bodies — with
formatting, links, variables, files, and images — organized in folders and reusable across
sequences.

## Purpose

Variables personalize messages at scale without editing each one manually; varying the
wording per recipient (fallbacks, conditions, Spintax, AI snippets) also keeps templates
from being identical, which helps [deliverability](/learn/email-deliverability). Templates
save the best-performing copy for reuse and share it with the team.

## Relationships

| Relationship | Object |
| --- | --- |
| Contact variables pull from | The contact card on the People page — see [Contacts](/specifications/contacts) |
| Team variables pull from | The contact owner, the logged-in Reply account, and the connected sending email or LinkedIn account |
| Custom variables pull from | Custom contact fields, including AI custom fields |
| AI variables pull from | A prompt processed by OpenAI per recipient, optionally with live web search |
| Used by | [Sequence steps](/specifications/sequence-steps) of every channel; step notes on Call steps |
| Preview data | The contact card; if the sequence has no contacts yet, the first contact from the People page (alphabetically) |

## Creation

**Inserting a variable.** Open or add the step you want to edit, click the **Variables**
icon in the top-left corner of the editor, pick the tab — **Contact** (basic and custom
fields), **Team**, or **Advanced** — and select the variable. AI variables have their own
**AI variables** entry point in the email body or subject line. Preview the result on the
right side of the email editor (the eye icon for LinkedIn, SMS, and WhatsApp) or send a
test email.

**Creating a template.** Hover over **Sequences** in the header and click **Templates**.
The tab shows three folders — Personal (only you), Team (shared), and Library (Reply's own
templates). Click **New Template**, name it, and click **Create**; the editor supports
text formatting, links, variables, and attached files and images.

**Saving a sequence as a template.** On the Sequences page, hover over a sequence, click
the three dots, choose **Save as template**, and edit the name and description. Reuse it
via **New Sequence → From template → Team templates**.

## Variable types

| Type | Pulls from | Syntax example |
| --- | --- | --- |
| Basic contact | Basic contact-card fields: name, company, title, location, engagement counts | `{{FirstName}}`, `{{Company}}` |
| Team | Contact owner, Reply account, sending email or LinkedIn account | `{{ContactOwner.FirstName}}`, `{{SendingEmail.SenderName}}` |
| Custom | Custom contact fields (including AI custom fields) | `{{Programming_Language}}` |
| Advanced — fallback | A default value used when the contact's data is missing | See the fenced examples below — the syntax uses a pipe |
| Advanced — conditional | If/else logic on contact data or the sending day | `{{#if Opens > 5}} … {{else}} … {{/if}}` |
| Advanced — date | The day, date, month, quarter, or time when the message is sent | `{{today}}`, `{{days_from_now 2}}` |
| AI | A prompt sent to OpenAI, generated per recipient just before sending | Prompt-based; inserted from the AI variables panel |
| Spintax | One option picked at random from a list, per message | See the fenced examples below |

Fallback and Spintax syntax (both use the pipe character):

```
{{Title | 'sales leader'}}                          fallback when Title is empty
{{Company | 'your company'}}                        fallback when Company is empty
{{Random | 'quick call' | 'short chat' | 'brief conversation'}}   Spintax: one option per message
```

### Basic contact variables

| Variable | Inserts |
| --- | --- |
| `{{FirstName}}` / `{{LastName}}` / `{{FullName}}` | The contact's first, last, or full name |
| `{{Title}}` / `{{Company}}` / `{{CompanySize}}` / `{{Industry}}` | Job title, company name, company size, company industry |
| `{{Email}}` / `{{Domain}}` / `{{Phone}}` | Email address, email domain, phone number |
| `{{LinkedIn}}` / `{{SalesNavigator}}` | LinkedIn profile URL, Sales Navigator profile link |
| `{{City}}` / `{{State}}` / `{{Country}}` | The contact's location fields |
| `{{Opens}}` / `{{Replies}}` / `{{Views}}` | How many times the contact opened your emails, replied, and total email views including repeat opens |
| `{{last_touch}}` | The day, week, month, or year of the last email sent or reply received — works only for email steps and only for emails sent within the current sequence |

### Team variables

| Prefix | Pulls from | Fields |
| --- | --- | --- |
| `{{Sender.Calendar}}` | The sequence owner's account | The calendar link |
| `{{ContactOwner.*}}` | The contact's owner | FirstName, LastName, FullName, Company, Phone, Email, Title |
| `{{ReplyAccount.*}}` | The logged-in Reply user | FirstName, LastName, FullName, Company, Phone, Email, Title |
| `{{SendingEmail.*}}` | The sending email account | SenderName, SenderFirstName, SenderLastName, Email |
| `{{SendingLinkedIn.*}}` | The LinkedIn account used to send | SenderFirstName, SenderName |

### Custom variables

Custom variables insert text or numeric values from custom fields on the contact card and
appear in the **Custom fields** section of the Contact tab. If a custom field name
contains spaces or special characters (such as `<`, `>`, `"`, `'`, `\`, `=`), Reply
replaces them with underscores when generating the variable name. Custom variables can be
used on their own or inside conditional variables. AI custom fields behave the same in the
panel; in preview, an enriched field shows its value, and an unenriched one is highlighted
in red as *Missing Data* — enrich AI fields before launching a sequence.

### Advanced variables

Conditional variables use an if/else structure with the operators `==`, `!=`, and `>`;
multi-word comparison values must be wrapped in quotes:

```
{{#if Title == 'Marketing Director' }} We have an offer for you! {{else}} It may be interesting for you. {{/if}}
{{#if Opens > 5 }} I see you are interested in our product. {{else}} Check out our new product! {{/if}}
{{#if Phone}} Can I call you on this phone number {{Phone}}? {{else}} What is your phone number? {{/if}}
```

Date variables key off the moment the email is sent:

| Variable | Inserts |
| --- | --- |
| `{{#if is_monday}} … {{/if}}` (and `is_tuesday` … `is_sunday`, `is_weekday`, `is_weekend`) | The wrapped text only when the email is sent on that day |
| `{{today}}` / `{{tomorrow}}` / `{{day_of_week}}` | The current or next day of the week |
| `{{now_date}}` / `{{now_month}}` / `{{now_quarter}}` / `{{now_year}}` | The sending date, month, quarter, or year |
| `{{days_from_now N}}` / `{{days_before_now N}}` | The day of the week N days after/before sending, counting weekends |
| `{{weekdays_from_now N}}` / `{{weekdays_before_now N}}` | The same, counting business days only |
| `{{month_from_now N}}` / `{{quarter_from_now N}}` | The month or quarter N periods ahead |
| `{{time_of_the_day}}` | A greeting word by send time: night (00:00–5:59), morning (6:00–11:59), afternoon (12:00–17:59), evening (18:00–23:59) |

### AI variables

An AI variable holds a prompt — your own or one from the library, such as *Randomize Any
Text*, *Find 3 Pain Points*, *Clean First Name*, or *Job Title Standardization* — that is
sent to OpenAI and returns customized content for each recipient. AI variables work in the
email body and the subject line; **Generate Preview** tests the prompt, and **Save to
library** stores it (saved prompts are private to your account and not visible to the
team). The content is generated just before the email is sent, so it never appears on the
Preview page. The **Use live web search** toggle switches between the free mode (the
model's own knowledge) and a research mode using an advanced OpenAI model with live
internet access.

### Spintax

Spintax is implemented with the `{{Random}}` variable: list the alternatives separated by
pipes and Reply picks one at random each time a message is sent. A space is required
before and after each pipe — incorrect spacing breaks the Spintax. Variables cannot be
placed inside a Spintax block (Reply does not support variable chaining within Spintax);
add them before or after the block instead:

```
{{Random | 'Hi' | 'Hello' | 'Hey'}}{{FirstName}}     correct
{{Random | 'Hi' | 'Hello' | 'Hey'{{FirstName}}}}     incorrect — variable inside the block
```

Conditional logic can be combined with Spintax by nesting `{{#if}} … {{else}} … {{/if}}`
blocks, with the final `{{else}}` acting as the default option.

## Processing behavior

Variables resolve when each message is generated: preview and test emails use real contact
data, Spintax picks one option per message, fallbacks substitute the default when the
field is empty, and AI variables are generated just before sending. In **Playbooks**,
using `{{ }}` around anything that is not a valid variable blocks saving with an
*Unrecognized variables found* banner — typos, names with spaces, if-conditions with
unquoted multi-word values, and unclosed `{{` expressions all trigger it; other editors
(sequence steps, Offers, AI Assistant settings) have their own validation behavior. For
literal placeholders that Reply should not replace, use square brackets, like
`[placeholder]`.

## Template management

| Action | Behavior |
| --- | --- |
| Move to folder | Personal — visible only to you; Team — visible to the whole team |
| Copy template | Copies the email text to paste into a sequence |
| Remove | Deletes the template; it stays visible on the stats page until the sequence is removed or archived |
| Search by title | Finds a template by name |
| Share a folder | Hover the personal folder → three dots → **Share**; the folder moves to the Team section |
| Create / edit / delete folders | The **+** icon creates a personal or team folder; deletion is permanent |

For email steps specifically: images are added by link (**Insert/Edit image**, with a
Source field, name, and dimensions), by upload, or through the HTML editor; fonts can be
changed **only** through the HTML editor (Source code icon) — for example
`<span style="font-size: 11px; font-family: georgia; color: black;">…</span>`; and a URL
stored in a custom field is hyperlinked either in the HTML editor with
`<a href="{{SomeUrlVariable}}">Link text</a>` or by selecting text, clicking the hyperlink
icon, and entering the custom field's name exactly as it appears in the Variables section.
The HTML editor accepts only basic attributes, and may need to be enabled for the account
on request. Managing the steps that carry these templates — variants, cloning, copying,
reordering — is specified in [Sequence steps](/specifications/sequence-steps).

## Side effects

- Turning on live web search makes each send consume 1 Reply credit per AI variable per contact — 50 contacts means 50 credits for one variable.
- Sharing a personal folder moves it to the Team section and makes it visible to the whole team.
- A removed template remains visible on the stats page until the sequence is removed or archived.

## Limits

| Limit | Value |
| --- | --- |
| AI variable with live web search | **1 Reply credit** per variable per contact |
| AI variable previews with live web search | **100** free per day; each additional preview consumes 1 credit |
| AI variable without live web search | Free |
| Variable names | No spaces; special characters in custom field names become underscores |
| `{{last_touch}}` scope | Email steps only, and only emails sent within the current sequence |

No limits on the number of templates, folders, or variables per message are documented.

## Deletion behavior

Templates are deleted with **Remove** — completely, though they stay visible on the stats
page until the sequence is removed or archived. Folders are deleted permanently via the
folder menu. Deletion of individual saved AI prompts is not documented.

## Edge cases

- Spintax breaks without a space before and after each pipe — the text may not render in the email body or preview.
- A variable inside a Spintax block does not work; place `{{FirstName}}` and similar outside the `{{Random}}` block.
- AI variable output is absent from the Preview page by design — use **Generate Preview** in the AI variables panel instead.
- Preview data falls back to the alphabetically first contact on the People page when the sequence has no contacts, so the preview may show an unrelated contact's data.
- For contacts missing a first name, a common pattern is storing "there" as the first name so `{{FirstName}}` renders "Hi there" — or use a fallback variable.
- Fonts can be changed only through the HTML editor — there is no documented way to change them elsewhere in the step editor.

## FAQ

### What happens when a contact is missing data for a variable?

Use a fallback: `{{Title | 'sales leader'}}` renders the default text when the field is
empty. Conditional variables (`{{#if}} … {{else}} … {{/if}}`) handle the same case with
different full sentences.

### Why doesn't my AI variable appear in the preview?

AI variable content is generated just before the email is sent, so it will not show on the
Preview page. Click **Generate Preview** inside the AI variables panel to test the prompt.

### Can I put a variable inside a Spintax block?

No. Reply does not support variable chaining within Spintax. Close the `{{Random}}` block
first and add the variable after it.

### How do I share templates with my team?

Move the template to the Team folder, or share a whole personal folder (three dots →
**Share**), which moves it to the Team section. Sharing works in both Team Edition Private
and Public modes.

### How do I change the font of my emails?

Only through the HTML editor: open the step, click the Source code icon, and wrap the body
in a styled `span` — Reply documents no other way to change the font.

## Related

- [Sequence steps](/specifications/sequence-steps)
- [Sequences](/specifications/sequences)
- [Email outreach](/capabilities/email-outreach)
- [Sequence design](/learn/sequence-design)
- [Playbooks](/specifications/playbooks)

## Build with Reply

- REST API: [docs.reply.io](https://docs.reply.io/api-reference/introduction) — the source of truth for the current API surface, including template endpoints
- MCP: [agents.reply.io/mcp](https://agents.reply.io/mcp) — agents read and edit sequence step content and variants
