# Write notification templates

A template is what actually gets sent when an event fires. Each one binds a method (Email, WhatsApp, Telegram, SMS) to a trigger event such as "Booking Confirmed", and carries the wording. No template for an event on a channel means nothing goes out on that channel.

Source: https://help.pigi.io/guides/company-setup/notifications/notification-templates

## Quick answers

**Where do I edit the wording of a notification?**
Company → Settings → Notifications → **Templates** tab, at
/school/admin/company/settings/notifications?tab=templates. Click the pencil on a row, or
**Add Template** for a new one.

**What can PiGi send notifications about?**
Three notification types, listed down the left of the Templates tab: **Bookings**,
**Student Flights** and **Compliance Documents**. Bookings carries nine events — Booking
Created, Booking Confirmed, Booking Cancelled, Booking Completed, Review Request, Weather
Hold, Flights On Hold, Day Cancelled and Operations Resumed.

**How do I add a placeholder like the customer's name?**
In the template editor, the **Context variables** panel on the left lists every variable
for the chosen event. Click one and it is inserted at your cursor as `{{variable_name}}`.
You can filter the list with the "Filter variables…" box.

**Why can't I pick a trigger event — it says "(configured)"?**
A template already exists for that event on that method. Only one template per method +
event pair is allowed. Edit the existing one, or pick a different method.

**Why is the template editor greyed out?**
The editor and live preview unlock only once **Method**, **Trigger event** and **Template
format** are all chosen — the three numbered steps across the top.

**How do I test a template before it goes live?**
Save the template, then press the send icon in the **Live preview** header (or the flask
icon on the row in the Templates list). Enter a test address or number and press **Send
Test**. The test renders your real template with sample data.

**How do I turn a notification off without deleting it?**
On the Templates list, flip the switch at the right of the row. The row dims and stops
sending; the wording is kept.

**Can I attach an image to a WhatsApp notification?**
Yes. In the editor, tick **Insert media** (WhatsApp only), choose a **Media Type** —
Image, Video or Document — and paste a **Media URL**. The message text becomes the
caption. SVG images are rejected: use PNG, JPG or WebP.

## What this is

A template ties together three things: which **method** carries it, which **trigger event**
fires it, and the **message body**. The Templates tab lists them per notification type,
with filters for channel and trigger. Creating or editing one opens a full editor with the
context-variable panel on the left, the message in the middle and a live preview on the
right — an iPhone WhatsApp mock-up, an email card or an SMS bubble with a segment count,
depending on the format.

## Before you start

- The method must already be configured on the **Methods** tab. If nothing is configured,
  the Templates tab says "No notification methods configured".
- You need the **admin** role to create, edit or delete templates.

## Steps

1. Open **Company → Settings → Notifications** → **Templates**.
2. Pick the notification type in the left sidebar — **Bookings**, **Student Flights** or
   **Compliance Documents**.
3. Press **Add Template**.
4. Step 1 — choose the **Method**. Step 2 — choose the **Trigger event**. Step 3 — choose
   the **Template format**.
5. Write the message in the editor. Click variables in the left panel to insert them.
6. Press **Create template**. The button then becomes **Update template** and you stay on
   the page.
7. Press the send icon in the **Live preview** header to send yourself a test.

## Fields

| Field | Required | What to enter |
|---|---|---|
| Method | Yes | Email, WhatsApp, Telegram or SMS. Locked once saved — "Method is locked once a template is saved." |
| Trigger event | Yes | The event that fires this message. Events already templated on this method are disabled. |
| Template format | Yes | Email: Plain Text, Rich Text, HTML, Markdown. WhatsApp: Plain Text, WhatsApp Formatting. Telegram: Plain Text, HTML. SMS: Plain Text. |
| Insert media | No | WhatsApp only. Reveals Media Type and Media URL. |
| Media URL | Only with media | A public URL. No SVG when the type is Image. |

## WhatsApp formatting

Choosing **WhatsApp Formatting** shows a notes panel in the editor. WhatsApp uses single
markers, not Markdown doubles: `*bold*`, `_italic_`, `~strikethrough~` and ``` for a
monospace block. The markers only work when they wrap the text with no space inside —
`*📌 Status*` renders bold, `* 📌 Status *` does not. `---` is rendered as literal dashes,
so use blank lines for separation.

## Known limitations

- **Only working events are offered.** The dropdowns list just the events PiGi actually
  sends notifications for, so every template you create can fire.
- **One template per method + event.** The same event can carry both an Email and a
  WhatsApp template, but not two of either.
- **Method and event lock after saving.** To change them, delete and recreate.
- **Test send needs a saved template.** Before the first save, the send icon is disabled
  with "Save the template first to send a test".
- **A test WhatsApp needs a live session.** If the WhatsApp session is not connected, the
  test fails with "WhatsApp session not connected".
- **The Twilio template picker never loads.** For a WhatsApp channel still pointed at an
  old Twilio connection, the approved-template selector always shows its error state.
  PiGi never sends through Twilio; your own message body still goes out over WhatsApp.

## Related

- [Choose how notifications reach people](notification-methods.md)
- [Notification troubleshooting](notification-troubleshooting.md)
- [Connect WhatsApp](connect-whatsapp.md)
