> 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/automatic-message-rules.md).

# Automatic Message Rules

Define when and how message templates are sent using flexible, time-based rules.

Automatic Message Rules define **when**, **where**, and **how** a message template is sent.

A **template** defines the content.\
A **rule** defines the logic.

You can attach **multiple rules to the same template**.

***

## 🧠 How rules work

* Each rule is linked to **one template**
* Each rule applies to **one unit and one channel**
* Each rule defines **one timing**

When creating rules, you can select **multiple units and multiple channels at once** — OkupAI creates one rule per unit/channel combination in a single step, and automatically **skips duplicates** that already exist.

{% hint style="info" %}
One template → many rules This keeps your messaging consistent and easy to manage.
{% endhint %}

## ➕ Adding a new rule

1. Open an existing **Message Template**
2. Scroll to **Associated Rules**
3. Click **Add new rule**

A rule editor appears below the template.

***

## ⚙️ Rule settings (explained)

### 🏷 Rule name

Internal name for your reference.

Choose something descriptive, for example:

* `Welcome – Booking confirmation`
* `Check-in reminder`
* `Checkout instructions`

***

### 🏠 Object

Select **which unit** this rule applies to.

This defines **where** the template is sent.

If you want the same message for multiple units, create **one rule per unit**.

***

### 📡 Channel

Choose **how the message is sent**:

* **Platform** (Airbnb, Booking.com, etc.)
* **WhatsApp**
* **SMS**
* **Email**

{% hint style="info" %}
Platform messages are sent via the booking platform. WhatsApp, SMS, and Email are sent directly and are **not auto-translated**.
{% endhint %}

***

### ⏯ Status

* **Active** → rule is running
* **Inactive** → rule is paused

Useful if you want to temporarily stop messages without deleting the rule.

***

## ⏰ Trigger event (most important)

The trigger event defines **which moment in time** the rule is based on.

Available options:

### 📅 Booking date

Send the message relative to **when the guest booked**.

Typical use:

* booking confirmation
* immediate welcome message

***

### 🧾 Online Check-In completed

Send the message relative to **when the guest completes online check-in**.

Typical use:

* confirmation
* next steps
* access instructions

***

### 🛎 Check-in date

Send the message relative to the **arrival date**.

Typical use:

* reminders
* arrival instructions
* door codes

***

### 🚪 Checkout date

Send the message relative to the **departure date**.

Typical use:

* checkout instructions
* review requests

***

## ⏱ Timing configuration

These fields work together to define **exact timing**.

### 🔢 Offset value

How much time relative to the trigger event?

### 📏 Offset unit

Choose the unit for the offset:

* Minutes
* Hours
* Days

### ↔️ Direction

* **Before** the event
* **After** the event

### 🕖 Time of day

Used only for **check-in** and **checkout dates**, since those are full-day events.

***

## 📌 Timing examples

### 1️⃣ Example 1 – Booking confirmation

* Trigger: **Booking date**
* Offset: `0` Minutes
* Direction: **After**

➡️ Message is sent **immediately when the booking is created**

### 2️⃣ Example 2 – Check-in reminder

* Trigger: **Check-in date**
* Offset: `1` Day
* Direction: **Before**
* Time: `19:00`

➡️ Message is sent **1 day before arrival at 19:00**

### 3️⃣ Example 3 – Online check-in completion

* Trigger: **Online Check-In completed**
* Offset: `0` Minutes
* Direction: **After**

➡️ Message is sent **immediately after the guest finishes check-in**

### 4️⃣ Example 4 – Post-booking follow-up

* Trigger: **Booking date**
* Offset: `2` Hours
* Direction: **After**

➡️ Message is sent **2 hours after booking**

***

## 🔍 Optional conditions

### 🪪 Condition: Online check-in already filled

* **Send only if not filled yet**
* **No condition**

Useful for **reminders**.

This prevents sending reminders to guests who already completed online check-in.

***

### ⏮ Send even if trigger is in the past

Controls what happens if the rule timing is **no longer possible**.

Example:

* Rule: *Send 7 days before check-in*
* Guest books **1 day before arrival**

Options:

* **Enabled (green)** → message is sent immediately
* **Disabled (red)** → message is skipped

***

## ✅ Saving the rule

1. Click **Save**
2. Set status to **Active**

If active, the rule is now **live** and will trigger automatically.

***

## 🧠 Best practices

* Start rules as **Inactive** while testing
* Use **clear rule names**
* Avoid overlapping rules with identical timing
* Use conditions to prevent unnecessary messages
