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

# Templates

> The texts Omnilinker fills in from an order when it writes to a buyer: the starter templates, the fields you can use and the rules a template must follow.

A template is the text of a message with fields that Omnilinker fills in from the order. **Message buyer**,
**Tell buyers about a delay** and the automatic messages all write from templates. A template has a purpose, such as
**Delay notice**, and a text for each channel and language it can be sent in.

## Starter templates

Every organization starts with five templates. Their names follow your organization's default language.

| Template | Purpose | Channels | What it says |
| - | - | - | - |
| **Delay notice** | Delay notice | E-mail, SMS | The order will ship later than planned, with the new shipping date, and how to cancel by replying. |
| **Ready for pickup** | Ready for pickup | E-mail, SMS | The order is waiting in the shop, with the pickup address and opening hours. |
| **Quote sent** | Quote | E-mail | A quote is attached, with its number and the date it is valid until. |
| **Thank you** | Thank you | E-mail | Thanks for the order, signed with your shop name. |
| **Review request** | Review request | E-mail | Asks how the order went, in general terms. It never asks for a particular rating. |

They exist in Polish and English. A message uses your organization's default language when the template has a text in it,
and Polish when it doesn't. The **Delay notice** also has an Allegro text; Omnilinker doesn't send messages to Allegro
buyers yet, so that text is unused for now. You can use all five as they are, change them, or delete them. A starter you
delete is not brought back.

The **Thank you** and **Review request** e-mails carry an unsubscribe link. Omnilinker adds the link and its sentence
itself, so leave links out of those two texts. See [Consent and opting out](https://docs.omnilinker.pl/customer-service/consent-and-opting-out#unsubscribe-links).

The **Ready for pickup** and **Delay notice** texts sign with your shop name, and the pickup text gives your pickup address
and opening hours. Fill them in under **Shop details** first; see [Customer service settings](https://docs.omnilinker.pl/customer-service/settings#shop-details).

## The Templates page

Open **Customer service** > **Templates**, or go to `/messaging/templates`. You need the **See templates** permission to
open the page and **Create and change templates and automatic messages** to change anything. Without the second you can
read every template but the page says "You can read templates but not change them."

The page is titled **Templates and automatic messages**, with three tabs: **Templates**, **Automatic messages** and
**Senders**. Each tab shows only if you may open it, and **Automatic messages** only while Automations are switched on. See
[Automatic messages](https://docs.omnilinker.pl/customer-service/automatic-messages).

On the left, the list groups your templates by purpose. Each row shows the template's name, its channels and languages,
and "Edited" with the date. Type in **Find a template** to narrow the list. Click **New template** to start one.

On the right, the editor opens for the template you pick:

* **Name**, **What it is for** (the purpose) and **Shortcut** (optional, typed after `/` in a reply box).
* **Texts of this template**: one tab for each channel and language. Remove a text with its **Remove this text**
  button, or add one with **Add a text for** and a channel and language. An e-mail text also has a **Subject**.
* **Insert**: click a field to put it in the text at the cursor. Each field shows an example of its value.
* **Preview**: the text filled in with sample values. Type an **Order number** (for example `10495` or `#10495`) and click
  **Show with this order** to see it filled in for a real order, and which fields that order can't fill. **Show with
  samples** goes back. Looking at an order needs access to **Orders** besides the template permission. The preview never
  shows the buyer's address or phone number.
* Under the preview, an SMS shows its parts ("2 SMS") and the characters in each part, with a warning that names the
  letters that make it a Unicode SMS. Other texts show "123 of 20000 characters". A text for Allegro or OLX also shows
  which marketplace rules it breaks.

Click **Create template** or **Save changes**, **Discard changes** to drop your edits, or **Delete** to remove the
template (messages already sent keep their text). If someone else saved the template while you were editing it, nothing is
overwritten: the editor says so and offers **Reload**.

### When an automatic message uses the template

While an automatic message that is switched on sends a template, the editor lists it ("Automatic messages that send this
template: …"). You can't delete that template, change its purpose or remove a channel the message sends on. Switch the
automatic message off first, or keep the purpose and the channels it uses.

## Fields you can use

A field is written between double braces, for example `{{ order.number }}`. A template that uses a field Omnilinker doesn't
know is refused when you save it.

| Field | Fills in |
| - | - |
| `order.number` | Order number |
| `order.external_id` | Marketplace order number |
| `order.status_for_customer` | Order status, as the customer sees it |
| `order.promised_date` | Promised delivery date |
| `order.new_ship_date` | New shipping date (the date you pick in a delay notice) |
| `buyer.first_name` | Customer's first name |
| `product.name` | Product name |
| `shipment.carrier`, `shipment.tracking_number`, `shipment.status` | Carrier, tracking number, shipment status |
| `invoice.number`, `invoice.ksef_number` | Invoice number, KSeF number |
| `seller.name` | Shop name: **Shop name in messages** from your settings, else your organization's name |
| `seller.pickup_address`, `seller.opening_hours` | **Pickup address** and **Opening hours** from your settings. Empty until you fill them in |
| `agent.first_name` | Your first name |
| `quote.number`, `quote.valid_until`, `company.name` | Quote number, date the quote is valid until, customer's company |

If an order has no value for a field the template uses, Omnilinker doesn't send the message with a blank: **Message buyer**
says "Fill in: …", and a bulk run or an automation skips the order and names the missing value.

## Rules a template must follow

A template is checked when you save it, and again when a message is sent. It is refused when:

* another template already uses the same shortcut (a lowercase word of letters, digits, hyphens or underscores, up to 32
  characters);
* no purpose is chosen, or no channel has a text;
* there is no Polish text for a channel it uses (Polish is the fallback language), or two texts share a channel and language;
* an e-mail text has no subject (up to 255 characters);
* a text is too long: 20,000 characters for e-mail, 1,000 for SMS, 2,000 for an Allegro message;
* it takes more than two seconds to fill in;
* a text meant for Allegro or OLX contains a link, an e-mail address, a phone number, an invitation to write outside the
  marketplace or a request to change a rating.

A template can't be sent on a channel its purpose isn't allowed on. A name is up to 128 characters.


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