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

# Template variables

> How to insert event data in a text with {{variable}}, the common variables, the date and money formats, and what happens with an unknown variable.

## At a glance

| Field | Value |
| - | - |
| Status | **Available** |
| Route | `/{locale}/notification/catalog/{event}/channels/{channel}`, **Variables** card |
| Menu | Notifications › Catalog › **Event catalog** › an event › **Channels** tab › a channel |
| Role | Notification Admin, Editor and Marketing (the other roles see them without inserting them) |
| Permission | `notification-template:edit` to insert |
| Feature flag | None |
| Last verified | 2026-11-20 against `develop` (`aed8bd19b`) |

## What it is for

A variable puts event data in the text: the coupon name, the merchant, the amount. It is written between double
braces, for example `You redeemed {{couponName}} at {{merchantName}}`, and on sending it is replaced by each
customer's real value.

## How to get there

* Open the template from its event's **Channels** tab ([Template editor](https://docs.bbrands.io/enterprise/notifications/templates/editor.md));
  the **Variables** card is at the end of the right column, under the preview and the sample data.

## What you see

![Template editor with the Variables card: Click a variable to insert it where the cursor is; event variables couponName and merchantName highlighted, and common variables account.name, recipient.first\_name, brand.name and links.preferences.](https://mintcdn.com/bbrands/N7_SfPLw3NjOYuO9/images/enterprise-notifications-screens/templates/editor.en.desktop.webp?fit=max\&auto=format\&n=N7_SfPLw3NjOYuO9\&q=85\&s=be9a0fc4882e11eee86e34fa7b708af5)

The Variables card: the event's at the top, the common ones below.

| # | Element | What it does |
| - | - | - |
| 1 | Event variables (highlighted) | The data the event carries, for example `{{couponName}}` |
| 2 | Common variables | Available on every event (table below) |
| 3 | Click a variable | Inserts it where the cursor is, in the text field you were editing |
| 4 | "Unknown variables: …" | Notice under the texts if you use a variable that does not exist |

| Common variable | What it puts |
| - | - |
| `{{account.name}}` | The account name |
| `{{recipient.first_name}}` | The recipient's first name (the account name when there is none) |
| `{{recipient.email}}` | The recipient's email address |
| `{{brand.name}}` | The event's brand name |
| `{{links.preferences}}` | The link to the customer's notification preferences |

## Step by step

### Insert a variable

**1. Place the cursor**

Click the text field, where the data goes.

**2. Click the variable**

In the **Variables** card, click `{{merchantName}}`. It is written where the cursor was.

**3. Look at the preview**

The preview replaces the variable with the sample data, for example "Café Altura".

### Format a date or an amount

Write the variable with a format in front:

| Write | Result |
| - | - |
| `{{date coupon.expiresAt "long"}}` | The date in words, in the customer's language |
| `{{money amount}}` | The amount in the language's currency format |
| `{{upper merchantName}}` | The text in capitals |
| `{{list benefits "✓ "}}` | Each item of a list on its own line, with the prefix in front; in the subject, a title or a button the items stay on one line, separated by commas |

## Business rules

| ID | Rule |
| - | - |
| R-01 | Only event variables or the common ones can be used; any other blocks publishing |
| R-02 | Values are escaped in email: data with `<` or `&` shows as is, without breaking the design |
| R-03 | The only formats are `date`, `money`, `upper` and `list` |
| R-04 | Publishing is validated with the longest sample data, to catch texts above the limit |
| R-05 | If the event declares no data, only the common variables are available |

## States and messages

| State | What you see | Why | What to do |
| - | - | - | - |
| Unknown variable | "Unknown variables: cupon" under the texts | The variable is not in the event | Fix it or use one from the card |
| Blocked on publish | **Some variables are not declared by the event**: "ES: cupon" | You tried to publish with an unknown variable | Fix it in each language listed |
| Event without data | "The event declares no data; only the common variables are available." | The event carries no data | Use the common ones |
| Read only | "Variables of the event data." and variables without click | No draft or your role does not edit | Create a draft |

## Errors

| Message | Cause | Backend code | Support action |
| - | - | - | - |
| **Validation error** on publish | The server found an unknown variable or a text above the limit | 422 | Check the field and the language it names |

## Why it works this way

Variables come from the event data because that is all the business flow sends. If a template asked for data that
does not arrive, the customer would get a gap in the text. That is why the editor and the server block publishing
with unknown variables.

## Technical detail

| Aspect | Detail |
| - | - |
| Event variables | Properties of the event's data schema (see its page in [Events](https://docs.bbrands.io/enterprise/notifications/events/index.md)) |
| Syntax | `{{path}}` over the data; helpers `date`, `money`, `upper`, `list` |
| Validation | In the editor (`template-editor-utils.ts`) and in the API on publish |

## FAQ and support cases

> [accordion] I need data the event does not carry
>
> It has to be added to the event in the code. Ask the technology team with the event and the data.

> [accordion] The preview shows the variable unreplaced
>
> Check it is spelled right (capitals included) and that it exists in the sample data.

## Related and history

* [Preview and test](https://docs.bbrands.io/enterprise/notifications/templates/preview-and-test.md)
* [Languages](https://docs.bbrands.io/enterprise/notifications/templates/languages.md)

| Date | Change |
| - | - |
| 2026-11-11 | First version |
| 2026-11-20 | The Variables card moves to the end of the right column; reached from the event's channels (T-42) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.