> For the complete documentation index, see [llms.txt](https://docs.okup.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.okup.ai/okupai-platform/messaging/automatic-messages/message-templates.md).

# Message Templates

Create reusable message templates with languages, images, and dynamic variables.

Create reusable message templates with languages, images, and dynamic variables.

***

## ✉️ Message Templates

Message templates are the building blocks of automatic communication in OkupAI.

A template defines **what** is sent to a guest — **when and to whom** is defined later using Message Rules.

***

## 🧠 What is a message template?

A message template is a reusable message that can:

* be written in **multiple languages**
* include **dynamic variables** (guest, booking, property data)
* include **images** per language
* be reused across many properties and events

A template does nothing by itself until it is linked to a rule.

### 💡 Example

> **Welcome message** "Hi {{guest\_name}}, thanks for booking {{unit\_name}}. We're looking forward to hosting you!"

{% hint style="info" %}
Think of templates as **message content**, and rules as **delivery logic**.
{% endhint %}

***

## ➕ Adding a new template

1. Go to **Messaging → Automation**
2. Click **Add new template** (top right)
3. The template is created and opens automatically

You are now on the **Template Details** page.

***

## 🌍 Template languages

Each template can contain multiple languages.

* Click **Add Language**
* Choose the language
* Write the message text for that language

### 🌍 How language selection works

* The booking platform sends the guest language to OkupAI
* OkupAI automatically selects the matching template language
* If no exact match exists, your default language is used

{% hint style="info" %}
Many booking platforms translate messages automatically. However, adding multiple languages is highly recommended if you send messages via **WhatsApp**, **Email**, or **SMS** — these are **not** translated automatically.
{% endhint %}

***

## 🖼 Images

You can add images **per language**:

* Drag & drop files into the upload area, or click to browse
* Reorder images by dragging — the order badge shows the sending order
* Each language can have different images

This is especially useful when your images contain text, or when you want to localize instructions or visuals.

***

## 🔁 Variables (dynamic content)

Variables adapt your message automatically to the guest, the booking, and the property.

### ⌨️ How to insert a variable

1. Type `{{` anywhere in the text
2. A searchable list of available variables appears
3. Select the variable you want

The value is filled automatically when the message is sent.

### 📆 Booking variables

| Variable                         | Content                        |
| -------------------------------- | ------------------------------ |
| `booking_id`                     | Unique booking identifier      |
| `booking_date`                   | Date when the booking was made |
| `checkin_date` / `checkout_date` | Stay dates                     |
| `nights_price`                   | Total price for the nights     |
| `cleaning_price`                 | Cleaning fee amount            |
| `platform_city_tax`              | City tax amount                |
| `currency`                       | Booking currency               |
| `payment_method`                 | Payment method used            |
| `platform_name`                  | Booking platform name          |

### 👤 Guest variables

| Variable                                   | Content                                                   |
| ------------------------------------------ | --------------------------------------------------------- |
| `guest_name`                               | Primary guest name                                        |
| `guest_email`                              | Guest email (online check-in first, platform as fallback) |
| `platform_guest_phone`                     | Guest phone from the platform                             |
| `platform_guest_origin`                    | Guest origin reported by the platform                     |
| `n_adults` / `n_children` / `total_guests` | Guest counts                                              |
| `ai_guest_country`                         | Guest country (AI detected)                               |

### 🪪 Online Check-In variables

Filled from your guests' Online Check-In submissions:

| Variable                                  | Content                        |
| ----------------------------------------- | ------------------------------ |
| `oci_guest_name`                          | Guest name(s) from check-in    |
| `oci_birthdate` / `oci_nationality`       | Guest identity data            |
| `oci_address` / `oci_country`             | Guest address data             |
| `oci_guest_phone`                         | Phone number(s) from check-in  |
| `oci_id_type_uploaded`                    | Uploaded ID document type(s)   |
| `oci_arrival_time` / `oci_departure_time` | Expected arrival / departure   |
| `oci_bed_wishes`                          | Bed preferences                |
| `oci_invoice_address`                     | Invoice address from check-in  |
| `oci_submission_date`                     | When check-in was submitted    |
| `has_completed_checkin`                   | Whether check-in was submitted |

### 🏠 Property variables

| Variable                                            | Content                      |
| --------------------------------------------------- | ---------------------------- |
| `unit_name`                                         | Friendly name of the unit    |
| `unit_floor` / `unit_door_number`                   | Location inside the building |
| `object_address` / `object_city` / `object_country` | Property address             |
| `object_max_guests_capacity`                        | Maximum guest capacity       |
| `checkin_time` / `checkout_time`                    | Standard times for the unit  |
| `wifi_login` / `wifi_password`                      | Wi-Fi credentials            |
| `taxi_number`                                       | Local taxi phone number      |

### 🔑 Access code variables

| Variable                             | Content                                                                                   |
| ------------------------------------ | ----------------------------------------------------------------------------------------- |
| `building_code`                      | Building entrance code                                                                    |
| `unit_door_code`                     | Unit door code                                                                            |
| `garage_door_code` / `basement_code` | Additional access codes                                                                   |
| `custom_code`                        | Custom property access code                                                               |
| `ttlock_passcode`                    | **Booking-specific smart lock passcode**, generated automatically by the lock integration |

{% hint style="warning" %}
`ttlock_passcode` requires the smart lock integration to be active for the property. The passcode is unique per booking and valid for the stay dates.
{% endhint %}

***

## 🔗 Templates vs Rules (important)

| Templates               | Rules                     |
| ----------------------- | ------------------------- |
| Define **what** is sent | Define **when & to whom** |
| Can be reused           | Trigger messages          |
| No timing               | Time-based or event-based |

A template is not associated with any event or unit until you create a rule.

***

## 📱 WhatsApp Template Approval

When using WhatsApp templates, they must be approved by Meta before they can be sent. If a template is not yet approved, you will see a message indicating that it was skipped due to pending approval.

{% hint style="info" %}
Check the template status in the **Messaging → Automation** section to ensure your WhatsApp templates are approved and ready for use.
{% endhint %}

***

### ✅ Next step: Message Rules

Once your template is ready:

➡️ Go to **Automatic Message Rules**

There, you will:

* choose **when** the message is sent
* select **which properties and channels** it applies to
* define conditions and timing
