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

# WhatsApp templates

> Register the templates Meta has approved, tell RuleInside what each one is for, and read their status at Meta.

WhatsApp only lets a business start a conversation with a template that Meta has approved. Free text cannot be sent
first. **WhatsApp templates** is where you tell RuleInside which of your approved templates to use, and for which job.

<Note>
  **You create and approve templates in Meta, not in RuleInside.** Write the template (its header, body, buttons and
  footer) in Meta's WhatsApp Manager and submit it there. Once Meta approves it, register it here by typing its exact
  name and language and saying what fills each numbered blank. There is no field for the wording anywhere in the
  portal: to change the wording, edit the template in WhatsApp Manager.
</Note>

## Before you start

<Steps>
  <Step title="Create the template in Meta">
    In Meta's WhatsApp Manager, write the template and submit it for review.
  </Step>

  <Step title="Wait for Meta's approval">
    Meta reviews each template, and each language of it, separately.
  </Step>

  <Step title="Note four things from WhatsApp Manager">
    The template's exact name, its language code (for example `en_US` or `it`), its category (Marketing, Utility or
    Authentication), and how many numbered blanks (`{{1}}`, `{{2}}` and so on) its body has.
  </Step>

  <Step title="Register it in RuleInside">
    Open **WhatsApp templates**, click **New template** and fill in the form described below.
  </Step>
</Steps>

## The templates list

The page lists every template you have registered, ordered by purpose and then kind.

| Column | What it shows |
| - | - |
| **Purpose** | The job the template does: **Immediate follow-up**, **Event follow-up**, **Re-engagement (campaigns)** or **Manual send**. |
| **Kind** | **Message** or **Call permission**. |
| **Template name** | The name exactly as you registered it. |
| **Language** | The language code exactly as you registered it, for example `en` or `en_US`. |
| **Category** | The Meta category you chose: **Marketing**, **Utility** or **Authentication**. Utility and Authentication are highlighted in amber, as a reminder that they are not held to the weekly marketing limit. |
| **At WhatsApp** | The template's status at Meta, read live each time the page opens. See [Status at WhatsApp](#status-at-whatsapp). |
| **Status** | **Enabled** (green) or **Disabled** (grey): whether RuleInside uses the template. |
| (no heading) | The **Edit** and **Delete** buttons for that template. |

Instead of the list, you may see:

* **This workspace isn't linked to a store yet.** Your workspace has no store attached. The **New template** button
  is shown but cannot be used. Contact support.
* **No templates yet. Add one to enable WhatsApp follow-ups and campaigns.** Nothing is registered yet.
* A red message saying the templates could not be loaded. Nothing was changed: refresh the page, and contact support
  if it keeps happening.

## Registering a template

<Steps>
  <Step title="Open the form">
    Click **New template**. A panel titled **New WhatsApp template** opens on the right. Nothing is saved until you
    click **Save template**.
  </Step>

  <Step title="Choose the purpose and kind">
    Pick what the template is for under **Purpose**, and leave **Kind** on **Message** unless you are registering a
    call permission template.
  </Step>

  <Step title="Copy the name and language from Meta">
    Type the **Template name** and **Language code** exactly as WhatsApp Manager shows them.
  </Step>

  <Step title="Match Meta's category">
    Pick the same **Meta category** that Meta gave the template.
  </Step>

  <Step title="Add one variable per blank">
    Under **Template variables**, click **Add variable** once for each numbered blank in the template body, in order,
    and choose what fills it.
  </Step>

  <Step title="Save">
    Leave **Enabled** on and click **Save template**. You see **Template saved.**, the panel closes and the list
    refreshes.
  </Step>
</Steps>

## Every field on the form

The form is the same for a new template (panel title **New WhatsApp template**) and for an existing one (panel title
**Edit WhatsApp template**). Only the account owner can open it and save it.

| Field | What it does | Allowed values and limits | Default | Who can change it |
| - | - | - | - | - |
| **Purpose** | Decides when RuleInside uses the template. | **Immediate follow-up**, **Event follow-up**, **Re-engagement (campaigns)** or **Manual send**. See [The four purposes](#the-four-purposes). | **Re-engagement (campaigns)** | Owner |
| **Kind** | A normal message, or a request for permission to place a WhatsApp call. | **Message** or **Call permission**. | **Message** | Owner |
| **Template name** | The template's name exactly as it appears in Meta's WhatsApp Manager. The example in the box is `order_confirmation`. | Required. Up to 512 characters. Spaces at either end are removed when you save. | Empty | Owner |
| **Language code** | Meta's language code for the approved template. The example in the box is `en_US`. | Required. Up to 20 characters. Spaces at either end are removed when you save. Must match Meta exactly: `en` and `en_US` are two different templates at Meta. | Empty | Owner |
| **Meta category** | The category Meta gave the template. It decides whether the weekly marketing limit and the marketing quiet hours apply when the template is sent. | **Marketing**, **Utility** or **Authentication**. | **Marketing** | Owner |
| **Send from (WhatsApp number)** | Which of your WhatsApp Business numbers sends this template. Leave it on automatic unless you run more than one number. | **Automatic (account default)**, or one of your WhatsApp numbers, shown as the number followed by the business account name in brackets. | **Automatic (account default)** | Owner |
| **Template variables** | One line for each numbered blank in the template body, in order, saying what fills it. | Up to 20 lines. Every line needs a value. See [Template variables](#template-variables). | No lines | Owner |
| **Enabled** | Only an enabled template is used for sends and campaigns. | On or off. | On | Owner |

<Note>
  RuleInside does not check the name, language or number of variables against Meta when you save. A mistake shows up
  afterwards in the **At WhatsApp** column, or as a failed send. The form's own reminder says it: the name, language
  and parameter count must match Meta exactly.
</Note>

The **Send from (WhatsApp number)** field appears only when your list of WhatsApp numbers can be loaded. If you do
not see it, open **Phone numbers** and check that your WhatsApp number is listed and connected.

### The four purposes

* **Immediate follow-up**: sent automatically right after a shopper who messaged your store on WhatsApp leaves their
  details in that chat (for example, to send a promised discount code). It is used only when automatic WhatsApp
  follow-up is switched on for your store, which it is not by default, and only if this template is enabled.
* **Event follow-up**: sent by an [automation](/automations) rule of the event follow-up type.
* **Re-engagement (campaigns)**: the template your WhatsApp [campaigns](/campaigns) send.
* **Manual send**: for sending one message yourself from [WhatsApp send](/whatsapp-send).

### Message and Call permission

Follow-ups, campaigns and manual sends all use **Message** templates. You can register a **Call permission**
template, but it cannot be chosen on **WhatsApp send**, which says call-permission templates can't be used to send a
message.

## Template variables

A template body can contain numbered blanks such as `{{1}}` and `{{2}}`. Each line under **Template variables** fills
one blank: the first line fills `{{1}}`, the second fills `{{2}}`, and so on. Each line shows the blank's number, a
source, a value box and a red **Remove** button.

| Source | What fills the blank | Value to type | Default |
| - | - | - | - |
| **Contact field** | A detail from the saved contact whose number you are messaging. | `name`, `email`, `phone`, or the exact name of a custom field on the contact. | A new line starts as **Contact field** with `name`. |
| **Send-time value** | A value typed at the moment of sending. On **WhatsApp send** you get one box for each name you choose here. | A short name for the value, for example `order_number`. | Empty |
| **Fixed text** | The same text on every send, for example a discount code. | The text itself. | Empty |

Rules for variables:

* **Order matters.** Removing a line renumbers the lines after it.
* **Only the body.** RuleInside fills the numbered blanks in the template body. It does not fill anything in the
  header or the buttons.
* **No empty lines.** If any line has no value, **Save template** stops with **Fill in every variable (or remove the
  empty ones).** and nothing is saved.
* **Changing a line's source clears its value.** A line switched back to **Contact field** returns to `name`.
* **The count must match Meta.** RuleInside cannot see the template body at Meta, so it cannot check that you added
  one line per blank. Meta refuses a send when the count is wrong.
* **Up to 20 lines.** At 20, **Add variable** is greyed out and the form says **Maximum of 20 variables reached.**
* **No blanks at all?** Leave the list empty. The form then says the template has no numbered blanks in its body.

<Tip>
  When a send happens, line breaks, tabs and repeated spaces in each value are turned into single spaces. If a value
  comes out empty (for example the contact has no name saved), the message is not sent: it is recorded as **Failed**
  with the detail `unresolved template params at index [n]`. The number counts from 0, so `index [0]` means `{{1}}`.
  Fill in that detail on the contact, or change the line's source.
</Tip>

## Buttons on the form

| Button | What happens |
| - | - |
| **Save template** | Checks the form, then saves. It reads **Saving…** while it works. On success you see **Template saved.** and the panel closes. If saving fails, a red message explains why (or says **Could not save the template.**) and the panel stays open with your entries. |
| **Cancel** | Closes the panel without saving. Clicking outside the panel or its close button does the same. |
| **Add variable** | Adds a variable line at the end. Nothing is saved until **Save template**. |
| **Remove** | Removes that variable line. Nothing is saved until **Save template**. |

## One template per purpose and kind

Each purpose can hold one **Message** template and one **Call permission** template. A second template for the same
purpose and kind does not sit beside the first: it replaces it.

<Warning>
  When the **Purpose** and **Kind** you pick already belong to another template, an amber warning appears at the top
  of the form: "A template for this purpose and kind already exists - saving will replace it, not add a new one."
  It does not stop you. If you save, the other template's registration is replaced.

  The new-template form starts on **Re-engagement (campaigns)** and **Message**, so if you already have a
  re-engagement message template you see this warning as soon as the panel opens. Change the purpose before saving
  unless you mean to replace it.
</Warning>

## Editing a template

Click **Edit** on a row. The **Edit WhatsApp template** panel opens with that template's settings filled in. Change
what you need and click **Save template**.

<Warning>
  **Changing the Purpose or Kind saves a copy and leaves the original.** The template is saved under the new purpose
  and kind (replacing whatever was there), and the original row stays exactly as it was. To move a template to another
  purpose, save it under the new purpose, then delete the old row.
</Warning>

### Enabling and disabling

Turn **Enabled** off and save to stop RuleInside using a template without deleting it. The **Status** column then
shows **Disabled**. While no enabled message template exists for a purpose:

* manual sends for that purpose are refused;
* automatic follow-ups for that purpose send nothing;
* campaigns that rely on it do not send.

Turn it back on and save to use it again.

## Deleting a template

Click **Delete** on a row. A dialog titled **Delete this template?** explains that the template will be removed and
that any follow-up or campaign relying on it will stop sending until you add a replacement.

* **Keep template** closes the dialog. Nothing changes.
* **Delete template** removes the registration. It reads **Deleting…** while it works, and you see **Template
  deleted.** when it is done.

<Warning>
  Deleting cannot be undone in the portal. To use the template again you register it again and re-enter its purpose,
  kind, category, number and variables. The template itself is **not** deleted at Meta: it stays in WhatsApp Manager.
</Warning>

If deleting fails, a red message explains why (or says **Could not delete the template.**). If the template had
already been removed, for example by another owner, the message is **WhatsApp template not found.**

## Template statuses

Each row has two separate statuses.

### Status (your switch)

| Status | Meaning |
| - | - |
| **Enabled** (green) | RuleInside uses this template for its purpose. |
| **Disabled** (grey) | RuleInside does not use it. It cannot be picked for a manual send, and follow-ups and campaigns for that purpose do not send. |

### Status at WhatsApp

For a number connected through Meta (it shows the **Connected through Meta** badge on **Phone numbers**), each time
the page opens RuleInside asks Meta for your templates and matches each row by its **name and language together**.

| Status | Colour | Meaning |
| - | - | - |
| **Approved** | Green | Meta has approved the template. |
| **Pending review** | Amber | Meta is still reviewing it. |
| **Rejected** | Red | Meta rejected it. |
| **Paused** | Red | Meta paused it. |
| **Disabled** | Red | Meta disabled it. This is Meta's status, not the same as **Disabled** in the **Status** column. |
| **Not on your WhatsApp account** | Red | Meta's full list has no template with this exact name and language. Usually a typo, the wrong language code, or a template approved on a different WhatsApp account from the one now connected. |
| **Could not check** | Grey | Meta could not be read just then (it did not answer in time, refused, or the connection needs attention), or your template list is very long and this template was not in the part that was read. Refresh later. |
| **Not checked** | Grey | Your WhatsApp number is not connected through Meta, so template statuses cannot be read. It does not mean anything is wrong. |
| Any other word | Red | A status Meta reported that RuleInside has no label for (for example ARCHIVED or DELETED), shown as Meta sent it. Only an approved template can be sent, so it is shown as a problem and never treated as approved. |

When Meta's category for a template differs from the **Meta category** you chose, a small line under the status
says so, for example **WhatsApp lists it as UTILITY**. Edit the template and pick the category Meta shows, so the
marketing limit and quiet hours apply correctly.

<Warning>
  **At WhatsApp** is there to warn you; it does not stop a send. A template shown as **Rejected** or **Not on your
  WhatsApp account** but still **Enabled** is still tried, Meta refuses it, and the send shows **Failed** in the send
  log. Fix or disable the template when you see a red status.
</Warning>

## How the category affects sending

The **Meta category** you choose here decides two rules for every send of the template:

* **Weekly marketing limit**: a contact receives at most 4 Marketing WhatsApp messages in any rolling 7 days. Utility
  and Authentication templates do not count and are not limited.
* **Marketing quiet hours**: a Marketing template is sent only during the calling hours where the person is, and
  waits until then otherwise (an immediate follow-up sent within 24 hours of the shopper's chat is the exception).
  Utility and Authentication templates do not wait.

Choose the category Meta gave the template. Every send also passes the consent, opt-out and do-not-contact checks
described in [Why a send is suppressed](/whatsapp-send#why-a-send-is-suppressed).

## STOP and START

A customer who replies **STOP** is opted out of WhatsApp messages and calls from your store, and every later send to them is
suppressed, whatever template you use. Only the customer can opt back in, by replying **START**. See
[STOP and START](/whatsapp#stop-and-start).

## Who can do what

* **Owner**: register, edit, enable, disable and delete templates.
* **Member**: sees the list and the statuses. In place of **New template** they see a note that only account owners
  can manage templates, and the **Edit** and **Delete** buttons are greyed out.

## Common questions

<AccordionGroup>
  <Accordion title="Can I write or edit a template's wording in RuleInside?">
    No. Write it, add any header, buttons and footer, and get it approved in Meta's WhatsApp Manager. Then register
    it here with its exact name and language. To change the wording, edit it at Meta.
  </Accordion>

  <Accordion title="Where do I put the header, buttons or footer?">
    In Meta's WhatsApp Manager. RuleInside fills only the numbered blanks in the template body.
  </Accordion>

  <Accordion title="My template says Not on your WhatsApp account.">
    Meta has no template with that exact name and language on the connected account. Check the spelling and the
    language code (`en` is not `en_US`), and check that the template was approved on the WhatsApp account that is
    connected now, not an older one. Edit the row to fix it.
  </Accordion>

  <Accordion title="My template says Not checked.">
    Your WhatsApp number is not connected through Meta, so RuleInside cannot read template statuses. Nothing is
    wrong; just make sure the name and language match WhatsApp Manager exactly.
  </Accordion>

  <Accordion title="Why does it say WhatsApp lists it as UTILITY (or MARKETING)?">
    Meta classifies the template differently from the category you chose. Edit the template and choose the category
    Meta shows, so the weekly limit and quiet hours apply correctly.
  </Accordion>

  <Accordion title="I saved a new template and my old one disappeared.">
    There is one template per purpose and kind, so saving a second one for the same pair replaces the first (the
    form warns you before you save). To keep both, register the old one again under another purpose.
  </Accordion>

  <Accordion title="I changed the Purpose and now I have two templates.">
    That is expected: changing **Purpose** or **Kind** saves a copy under the new pair and leaves the original.
    Delete the original if you no longer want it.
  </Accordion>

  <Accordion title="What does Call permission do?">
    You can register a call permission template, but follow-ups, campaigns and manual sends all use **Message**
    templates, and **WhatsApp send** cannot use a call permission template.
  </Accordion>

  <Accordion title="I can't see Send from (WhatsApp number).">
    It appears only when your list of WhatsApp numbers loads. Open **Phone numbers** and check your WhatsApp number
    is there and connected.
  </Accordion>

  <Accordion title="If I delete a template, is it removed from Meta?">
    No. Only the registration in RuleInside is removed. The template stays in WhatsApp Manager and you can register
    it again. Follow-ups and campaigns for that purpose stop until you register a replacement.
  </Accordion>

  <Accordion title="Can I send a normal text message instead of a template?">
    No. WhatsApp requires a pre-approved template to start a conversation, so RuleInside cannot send free-form text.
  </Accordion>

  <Accordion title="Can a team member who is not the owner add or edit templates?">
    No. Members can see the list and statuses, but only the account owner can change them.
  </Accordion>
</AccordionGroup>


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