> For the complete documentation index, see [llms.txt](https://help.novatalks.com.ua/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.novatalks.com.ua/en/get-started/conversations/conversation-panel/hsm-templates.md).

# HSM templates in the WhatsApp Business API

### What are HSM templates?

**HSM (Highly Structured Message) templates** are pre-agreed with Meta standard messages that businesses can use to start communicating with customers via the WhatsApp Business API. Messages can include appointment reminders, delivery information, payment updates, etc.

{% hint style="success" %}
Templates are created and approved via [WhatsApp Manager](https://business.facebook.com/wa/manage/message-templates/).
{% endhint %}

A template can include a header (text or attachments: images, videos, PDFs), body text with the ability to add variables, a footer, and buttons.

{% hint style="info" %}
Currently, templates containing Catalogue, Location, and Autocomplete Authentication are not supported (Authentication templates with code copying are supported).
{% endhint %}

***

### A 24-hour window for communication

WhatsApp Business uses 24-hour sessions for messaging.

When a customer sends a message to your number, a 24-hour window opens during which you can write free-form messages to users.

Outside of the 24-hour customer service window, you can only send HSM-approved templates. As soon as a customer replies to a template message, a new 24-hour window for communication opens.

Using HSM templates allows you to initiate a dialogue even with customers who have not yet written to the company.

***

### Sending an HSM template from NovaTalks

To send an HSM template from NovaTalks, in the message sending panel, enter the text in the appropriate markup consisting of several lines:

* **@HSM@ -** a label that informs the system that an HSM template is being sent.
* **template\_name|language -** the name of the template in lowercase with lowercase underscore and the [language code](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages). They must be the same as in the Meta template builder.
* **Template variables -** names of the template variables (if exists).

If the template contains an **attachment**, it must be attached to the message.

{% hint style="warning" %}
**Features of adding variables:**

* If several variables are used in a template, each variable must be written on a new line in the sequence specified in the template.
* If the template contains a button that contains a variable, the value of this variable must be added to the markup.
* If the template contains variables and they are not specified in the message, the template will not be sent.
* If the template contains a **Copy Code** button, the code must be specified twice in the markup of the message to be sent from NovaTalks: as a variable value in the body text and as a variable value for the button.
* You can substitute NovaTalks variables. To do this, enter two double curly brackets {{ in the corresponding line, after which a list of available variables will appear.
  {% endhint %}

After sending the template, the text and other elements from the template registered in WhatsApp Manager will be added to the message that will be sent to the client.&#x20;

The NovaTalks user will see it as a markup in the message history window in Conversation.

{% hint style="danger" %}
Before sending the template, make sure that the message does not contain any extra spaces or characters and that it follows the structure. Otherwise, it will not be delivered.
{% endhint %}

{% hint style="success" %}
For convenience, we recommend adding the HSM template structure to [Canned responces](/en/get-started/settings/canned-responses.md).
{% endhint %}

***

## Examples of HSM templates

### HSM template without variables and attachments

#### **Setting up a template in Meta:**

<figure><img src="/files/Mw2dz7qQUgTFWJpmnUIK" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks

<figure><img src="/files/G31MGS5nmGvmo3EqJajS" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="/files/XJHtyvQ3NGbQ0iOUDtnK" alt=""><figcaption></figcaption></figure>

### HSM template with variables in the main text

#### Setting up a template in Meta:

<figure><img src="/files/c3AywKLQmMnvudGY3MHV" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="/files/ZvtRAHmsPKccykZpyMeK" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="/files/unOlhkqAgQ2IsXr0b4RN" alt=""><figcaption></figcaption></figure>

### HSM template using the **NovaTalks** variable

#### Setting up a template in Meta:

<figure><img src="/files/YURrigf8OGLVolXFb23x" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="/files/47QOpySG1OzFtdTQICyH" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="/files/8HfBvKi14EskcJLm0RIc" alt=""><figcaption></figcaption></figure>

### HSM template with a Button

Setting up a template in Meta:

<figure><img src="/files/6hDz0ur5Mwlj9LxqJmIj" alt=""><figcaption></figcaption></figure>

Marking up a template for submission to NovaTalks:

<figure><img src="/files/VhdAlmcTi0mt3VqWIfOh" alt=""><figcaption></figcaption></figure>

The message that the client will receive:

<figure><img src="/files/3Df2ItOKNgF4ZN3Xcsoz" alt=""><figcaption></figcaption></figure>

### HSM template with variables in the Header, Body and Button

#### Setting up a template in Meta:

<figure><img src="/files/5D2F0QpFV5eCrtF8cK83" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="/files/UFmzJwLt0moB4EWRYq8Q" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="/files/C3C2ozTGXTsL8evSp6K7" alt=""><figcaption></figcaption></figure>

### HSM template with attachment

#### Setting up a template in Meta:

<figure><img src="/files/AX5cyBYOfj876WTOIeaZ" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="/files/4u2OR1H1001ud7Qd22UE" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="/files/EFjz3NvwLTxYMDMYNWon" alt=""><figcaption></figcaption></figure>

### HSM Authentication template

#### Setting up a template in Meta:

<figure><img src="/files/2Y0t5yMk9TckDEKAWLTp" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="/files/I1N9G3xSKhAGWzcpx1Vt" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="/files/TR0XXzRQg7uVZSYGyesB" alt=""><figcaption></figcaption></figure>
