# whatsapp\_template

### <mark style="color:orange;">`whatsapp_template(name=String, components=Array, language=String)`</mark>

{% hint style="success" %}

### Create a template

In order to create a WhatsApp Template, [read this guide](https://developers.facebook.com/docs/whatsapp/message-templates/creation/).
{% endhint %}

## **Platforms**

<table><thead><tr><th width="362.78343949044586">Platform</th><th data-type="checkbox">Supported</th></tr></thead><tbody><tr><td>Messenger</td><td>false</td></tr><tr><td>WhatsApp</td><td>true</td></tr><tr><td>Telegram</td><td>false</td></tr></tbody></table>

## Usage

```ruby
@reply.whatsapp_template("hello_world")
```

### On Demand

```ruby
user = User.first
user.notification.whatsapp_template(
  "sample_issue_resolution",
  [
    {
      type: :body,
      parameters: [
        {
          type: :text,
          text: "Martín"
        }
      ]
    }
  ] 
)
user.send
```

## Params

<table><thead><tr><th width="150">Name</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:orange;"><code>name</code></mark><br><em>String</em></td><td><p><strong>Required.</strong></p><p>Name of the template.</p></td></tr><tr><td><mark style="color:orange;"><code>components</code></mark><br><em>Array</em></td><td><strong>Optional.</strong><br>Array of <code>components</code> objects containing the parameters of the message. <a href="https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#components-object">Read more</a>.</td></tr><tr><td><mark style="color:orange;"><code>language</code></mark><br><em>String</em></td><td><strong>Optional</strong>.<br>Contains a <code>language</code> object. Specifies the language the template may be rendered in. By default: <em>"en_US"</em>.</td></tr></tbody></table>

{% hint style="info" %}
Learn more about WhatsApp Templates in the [official documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#template-object).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kogno.io/replies-notifications/whatsapp_template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
