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

# Automation

> Messages that go out on their own at a booking's events: rules, email and WhatsApp templates, marketing consent, and the logs.

**Automation**, in the Guests & Marketing group, sends guests messages without you pressing anything: the confirmation, pre-arrival instructions, a thank-you after departure. It is part of your subscription's automation rules module and needs permission to manage messages (by default **Owner** and **Admin**).

The tabs: **Rules**, **Email templates**, **WhatsApp templates** and **Logs**.

## Templates

A rule sends a template, so start there. **Message Templates** → a new template: **Template Name**, the type (Email, SMS or platform message), the language, the subject and the text. A template used by a rule cannot be deleted.

<Note>
  A template can exist in several languages: each language version has the same name and slug. A rule sends each guest the version in the guest's language; when there is none, the version in your organization's default language; when there is none either, the version the rule names. A version that is switched off is skipped. The same applies to a resend and to a template inserted into a conversation. In the editor, **Languages** shows the versions of the template, **Add Italian** (or the language that is missing) creates that version from the current text, and the template list marks the languages a template does not have yet.

  The sentences Gridbeds adds around your text in an email — the sign-off, the unsubscribe line on marketing emails, the banner on a test — are written in the template's own language, whatever language your screen is in. For a language Gridbeds has no translation for, they are in English.
</Note>

### Formatting an email

The text of an email template is written in an editor with a toolbar (**Text formatting**): **Bold**, **Italic**, **Underline**, **Bulleted list**, **Numbered list** and **Insert link** (Ctrl+K, or ⌘K on a Mac). Nothing more is offered on purpose: these are the formats every email program shows the same way. The arrow keys move along the toolbar. An SMS or a platform message stays plain text, and so does a WhatsApp template.

**Insert variable** lists the variables that work and narrows the list as you type. A variable sits in the text as a small label, `{{guest_first_name}}` for example, that you delete or move as one piece, and copy and paste carry it along. A label for a name that is not a variable is shown in red, with a warning, and is not replaced. A link can start with a variable, such as `{{booking_url}}`: type it in the address box of **Insert link**.

Pasting from Word or Google Docs keeps bold, italic, lists and links and leaves the rest of the formatting behind. Pasted plain text keeps its blank lines as paragraphs and its line breaks as line breaks.

Templates written before the editor were converted once. A blank line became a new paragraph, `**bold**`, `[text](address)` and lists became formatting, and a line break you typed stayed a line break.

When a rule falls back from email to SMS or WhatsApp, or a template is inserted into a conversation, the formatted text is sent as plain text: paragraphs apart, list items as lines starting with "- ", a link as "text (address)".

### Variables

Put variables between double braces in the text, `{{guest_first_name}}` for example, filled in for each guest. The template editor lists exactly the variables that work, and they work everywhere: in the emails rules send, in a template you insert into a conversation, in a broadcast, in a campaign (the guest, property and business ones) and in a rule's preview. A variable with nothing to read, such as a check-in date in a message that is not about a stay, is left blank: it is never written out as `{{...}}`.

| About | Variables |
| - | - |
| The guest | `{{guest_name}}`, `{{guest_first_name}}`, `{{guest_last_name}}` |
| The stay | `{{booking_number}}`, `{{check_in_date}}`, `{{check_in_time}}`, `{{check_out_date}}`, `{{check_out_time}}`, `{{nights_count}}`, `{{guests_count}}`, `{{adults_count}}`, `{{children_count}}`, `{{total_price}}` |
| The property | `{{property_name}}`, `{{property_address}}`, `{{property_city}}`, `{{property_country}}`, `{{wifi_network}}`, `{{wifi_password}}`, `{{parking_instructions}}`, `{{access_code}}`, `{{house_rules}}` |
| You | `{{host_name}}`, `{{host_phone}}`, `{{host_email}}`, `{{organization_name}}` |

`{{host_name}}` is the member who is writing, or your business when a rule sends: never Gridbeds. Dates are written day.month.year. Templates written before with the older spellings (`{{check_in}}`, `{{check_out}}`, `{{booking_reference}}`, `{{total_guests}}`, `{{wifi_ssid}}`, `{{access_instructions}}`, `{{guest_email}}`, `{{guest_phone}}`) keep working; use the names above in new ones.

### Preview and test

Editing a saved template shows, beside the editor, the message as the guest gets it: the real email (in a frame, as a desktop or a phone) or the text of an SMS. **Preview as** fills it with **Sample data** or one of the latest bookings; it follows what you type after a short pause, and is always written in the template's own language, whatever language your screen is in.

Above the message, a strip names what to fix: the variables that would arrive empty for that booking ("1 variable is empty for this booking: `{{wifi_password}}`") and anything between braces that is not a variable, with the closest real one ("`{{gest_name}}` is not a variable. Did you mean `{{guest_name}}`?"). Click a name to jump to it in the text. **Languages** switches to the same message in its other languages.

For an SMS, a counter shows its length and cost, for example "148 / 160 · 1 SMS · GSM-7". Romanian ș, ț, ă, â and î, and emoji, are not in the GSM-7 alphabet: one of them makes the whole message UCS-2, 70 characters per SMS instead of 160.

**Send me a test** (with permission to manage messages, email templates only) sends the email to you, or to up to five colleagues from your organization, with "\[TEST]" in front of the subject. **All languages** sends it in every language the message is written in; **Use this booking's data** fills it from the booking you are previewing. **Ctrl+Enter** sends. You have 10 tests an hour; the notice after a test says how many are left.

### WhatsApp templates

On WhatsApp, a message sent outside the 24-hour window must be a template approved by Meta. **WhatsApp templates** → a blank template or one from the library: name, language, category (utility, marketing or authentication), the text with `{{1}}`, `{{2}}`… and a sample for each, optionally a button. **Submit for approval**, then sync the status: **Draft**, **Received**, **Pending review**, **Approved**, **Rejected**, **Paused**, **Disabled**. An approved template can no longer be changed.

## Rules

**Automation Rules** → **Create Rule**:

| Field | What you choose |
| - | - |
| **Rule Name** | "Instructions 2 days before", for example. |
| **Trigger Event** | Booking Created, Booking Confirmed, Booking Cancelled, Days Before Check-in, Check-in Day, Mid-Stay, Check-out Day, Days After Check-out, Payment Received, Payment Failed, Transfer Confirmed, Before a Transfer Pickup (see [Transfers](/en/transfers)), Room Ready, Checked In and Room Ready, Come to Reception (sent by the arrival queue; created switched off when the queue is turned on). |
| **Message Template** | Required in practice: a rule without a template sends nothing. It is also the fallback message if WhatsApp or SMS cannot be delivered. |
| **Send Via** | **Platform Message**, **Email Only**, **SMS**, **WhatsApp** (with a WhatsApp template), **Booking Channel** (a message on Booking.com, Airbnb…) or **All Channels** (today it sends email only). If the SMS cannot go out, email is sent; WhatsApp falls back to SMS, then email. |
| **Purpose** | **Transactional** or **Marketing** — see below. |
| **Delay Amount** / **Delay Unit** | Minutes, hours or days; for "Days Before Check-in" it counts back from arrival, for "Before a Transfer Pickup" from the pickup. |

The day-based events (before check-in, arrival day, mid-stay, departure day, after check-out) are checked once a day, at 09:00.

### Transactional or marketing

* **Transactional** — "A stay operation — sent even to a guest who unsubscribed from marketing (a booking confirmation, a check-in link)."
* **Marketing** — "A re-engagement offer or campaign — blocked once the guest clicks unsubscribe on any marketing email from you (a "come back" message or a review request)." It goes only to guests who agreed to marketing on that channel and have not unsubscribed; a marketing rule is never sent over the booking channel.

Guests give their marketing consent in their portal (at online check-in, "Marketing (optional)", and in their communication preferences). They unsubscribe from the link in the email or by replying STOP to an SMS or on WhatsApp. In the guest's profile, **Marketing Communications** shows the email consent.

Marketing consent is given, not assumed: a guest is not opted in to marketing until they tick it themselves or you record it on their profile, and every tick and untick is kept with who made it, when and where. Every step of a marketing rule's fallback chain (WhatsApp, then SMS, then email) asks the consent of the channel it is about to use.

<Note>
  **Unticking and unsubscribing are different things.** Unticking **Marketing Communications** on a guest's profile only withdraws the consent, and ticking it again gives it back. What a guest does themselves is kept apart, and a tick on the profile does not undo it: clicking Unsubscribe in an email, replying STOP, marking an email as spam, or an address that bounced for good. The profile says which of them applies and since when, under the box; only the guest can subscribe again (in their portal, at online check-in, or by replying START).
</Note>

## Logs

**Email Logs** shows each email the automations sent, with its status: queued, sent, delivered, opened, clicked, bounced or failed. Only failed or bounced emails can be resent.

<Note>
  Gridbeds opens sending to guests (email, SMS, WhatsApp) per organization; until then the rules send nothing — see [Messages](/en/messages#when-a-message-does-not-go-out). A template can be previewed against a booking and sent to you as a test (see [Preview and test](#preview-and-test)); a rule can be tested on a booking, see below.
</Note>

## A rule's activity and its test

Click a rule's name, or the **Activity** button on its row, to open the rule on two tabs.

**Activity** lists every run of the rule, newest first: when, the guest, the booking (a link to it), the channel it went out on, the outcome — **Sent**, **Skipped** or **Failed** — and, when it did not send, the reason in words:

| Reason | What it means |
| - | - |
| Already sent for this stay (no duplicate) | The rule had already reached this guest for this booking. Expected, not a problem. |
| Sending to guests is not open for this organization yet | Gridbeds has not opened this channel for you yet. |
| The guest has not agreed to marketing on this channel | A marketing rule, and the guest has not opted in (or unsubscribed). |
| The guest turned this channel off or never opted in | A transactional rule, and the guest switched the channel off, replied STOP, or never opted in to WhatsApp. |
| The guest has no address for this channel | No email address, or no phone number. |
| The message template is missing or not approved | The rule's template was deleted, or its WhatsApp template is not approved. |
| The booking's channel cannot carry this message | The booking has no conversation on its channel, or the channel carries no messages. |
| The provider did not deliver it | The email or SMS provider refused or failed the send. |
| Every channel of the rule failed | Each channel the rule tried failed, each for its own reason; open the row to see them. |
| The transfer no longer runs | A transfer message for a transfer that was cancelled or removed. Expected. |
| The pickup moved | A pickup reminder for a time that changed; the reminder for the new time is queued. Expected. |

Filter by outcome, channel and period (the last 7, 30 or 90 days, or all time). The counts at the top cover the whole period, with the failure rate. When a rule fell back to another channel, open the row to see why the earlier channels did not carry it. Reading the activity needs the **View messages** permission.

**Test** shows what a real run would do for one booking, without messaging the guest: pick a booking (search by reference or guest), then **Test on this booking**. You see when the message would go out (or that its time has already passed, and a real run would send right away), each channel of the rule with a tick or the reason it could not be used, which one would carry it, and the checks — sending open on that channel, the guest's consent, not already sent for this stay. Below it is the message itself, with the variables filled in for that booking; **Show variables** lists each one and marks the empty ones. A test is kept in the activity, shown only with **Show tests**. Testing needs the **Manage messages** permission.


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