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

# Message templates

> Change the words of notifications in the bell and in notification emails, per type and language.

Message templates decide the words people see: the title and text of a notification in the bell and the inbox, and the
subject and body of notification emails, digests and daily summaries. "Every template starts from a working default;
change only what you need."

You need the **Manage message templates** permission, under **Notification Center**. Open **Notifications** > **How I
get notified**, and under **Workspace**, choose **Message templates**.

## Choose the template

The bar at the top picks one template:

* **Notification type**: which notifications it is for.
* **Bell** or **Email**: the channel. Digests and summaries have an email template only.
* **English** or **Polski**: the language. A dot marks a language whose template you changed.

On the right, **Default** means the template is unchanged, and **Edited · differs from default** that it has been
changed.

| Notification type | Used for |
| - | - |
| **Price alerts**, **MAP and violations**, **Stale data**, **Competitor changes**, **Compliance** | Alerts from Pricing Intelligence alert rules, by the rule's alert type. |
| **Stock, marketplaces and orders** | Every other notification: inventory, marketplaces, orders, printing, automations, API keys, compliance cases handed to an account manager, and test alerts from escalation policies. |
| **Escalation** | The copy people get when an alert is escalated to them. |
| **Bundle digest** | The email that carries a digest. |
| **Daily summary** | The email that carries a daily summary. |

Each person gets templates in their own language. "Templates edited in one language only: N. People who use the other
language get its default text." Edit both languages to keep them in step.

## Edit a template

<Steps>
  <Step title="Change the text">
    For email, edit **Subject** and **Body (HTML)**. For the bell, edit **Title** and **Text**.

    Templates use the Scriban syntax: a variable is written in double braces, such as `{{ title }}`, and you can use
    `{{ if … }} … {{ end }}` and `{{ for … }} … {{ end }}`.
  </Step>

  <Step title="Insert variables">
    Under **Insert a variable**, click a variable to add it to the text. Each one shows an example value.
  </Step>

  <Step title="Check the preview">
    The **Live preview** on the right shows the result as you type. For an alert type, choose one of your recent
    notifications in **Preview with** to see it with real values; otherwise it uses example values. Under the text,
    "Compiles · N variables · values are escaped automatically" means the template works; an error shows the problem
    instead.
  </Step>

  <Step title="Send yourself a test, for email">
    Click **Send a test to me**. "A test went to your email address."
  </Step>

  <Step title="Save">
    Click **Save template**. You cannot save a template that does not compile.
  </Step>
</Steps>

If you switch to another template with unsaved changes, Omnilinker asks "Discard your unsaved changes to this
template?".

To go back to the shipped text, click **Reset to default** and confirm "Replace this template with the default text?".

### Variables

Alert templates can use:

| Variable | Value |
| - | - |
| `title` | The notification's own title, as its module wrote it |
| `body` | The notification's own text |
| `severity` | Its severity, such as **Critical** |
| `sourceLabel` | The module it came from, such as **Pricing Intelligence** |
| `recipientFirstName`, `recipientName` | The person it is for |
| `actionUrl` | The page it is about |
| `occurrenceCount` | How many times it was raised in the duplicate window |
| `inboxUrl` | The notification in the inbox |
| `settingsUrl` | **How I get notified** |
| `facts` | The details its source sent, as a list of `label` and `value` |

Pricing Intelligence alert types also have `productName`, `merchantName`, `newPrice`, `previousPrice`,
`priceChangePercent`, `ruleName` and `offerUrl`.

Digest and summary templates have `recipientFirstName`, `recipientName`, `count` (notifications), `threadCount`
(topics), `periodLabel` (for example "between 13:00 and 14:00"), `inboxUrl`, `settingsUrl`, and the list of threads.
Look at the default text for how it lists them.

In email bodies, every value is HTML-escaped before it is inserted, so text from a source, such as a competitor's name,
can never add markup to the email.

## What a template change affects

* **The bell template** is applied when a notification arrives, and the inbox keeps that text: "The inbox stores the
  same rendered text, so the bell, the inbox and the email always match." A change applies to notifications that arrive
  after you save; ones already in people's inboxes keep their text.
* **Email templates** apply to every email sent after you save.

If a bell template cannot be applied, the notification keeps its module's own text, so a broken template never holds
notifications back.

A template must finish within 10 seconds, loop at most 50,000 times and write at most 1,000,000 characters. A template
that does more is stopped: "Stopped: a template must finish within … s, loop at most … times and write at most …
characters."

## Troubleshooting

<AccordionGroup>
  <Accordion title="“The template does not compile: …”">
    The text after the colon names the problem and its line, for example a missing `{{ end }}`. Fix it; the preview
    shows the result once the template compiles.
  </Accordion>

  <Accordion title="“This person has no email address.”">
    The test goes to your own account's address. Add an email address to your account and send the test again.
  </Accordion>

  <Accordion title="People still see the old text">
    Notifications already in the inbox keep the text they arrived with. Check also that you edited the language those
    people use.
  </Accordion>
</AccordionGroup>

<CardGroup cols={2}>
  <Card title="Notification channels" href="/notifications/channels">
    Set up the email the templates are sent by.
  </Card>

  <Card title="Notification inbox" href="/notifications/inbox">
    Where the bell text appears.
  </Card>
</CardGroup>


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