1. Whatsapp
  2. Template Message

Whatsapp

Template Message

Send a preconfigure Whatsapp Template Message. Custom templates have to be preconfigured on Facebook before they can be sent on Stubber. Since all conversations with clients have to be initiated with a template message, Stubber provides a few default template messages eg. general_interaction_request and general_stub_update.

Basic Usage

loading...

Parameters

Everything inside platforms.meta_whatsapp should be considered parameters for this notification. There are top level parameters that describe the message type and other general message behaviours, and then there are nested parameters dependent on the message type.

Only nested parameters for message_type: template is explained here, for all top level parameters, see the top level Whatsapp documentation

message_type

required
string

Indicates the type of message that is going to be sent. This also will determine what the contents of the params object should be.

Available message types are:


params

required
object

Contains the parameters for the message and will depend on the message_type setting. See the message_type specific documentation above for the message type specific parameters.


params.template

required
object

Object is required if the message_type is template. This object should change to match what message_type is set to.

Default: null


params.template.whatsapp_template_name

required
string

The name of the preconfigured Whatsapp template. This name should match the name of the template on Facebook.

Default: null


params.template.whatsapp_template_params_array

required
array

This array is used to dynamically enter values for parameters, as they are set up on your Facebook template. We detect when templates are created for the first time and automatically create a valid configuration for you to be able to use this parameter. No setup is required.

Example of how this can be used:

If your template on Facebook contains a Header and Body as below:

Header:

        Hi {{1}}

      

Body:

        {{1}} would like to interact with you on Whatsapp.
Subject : {{2}}

To allow interaction please click "Allow".

      

Then values can substituted as follows:

editor
        ["~~stubpost.data.customer_name", "~~stub.data.org_name", "~~stub.subject"];

      

It is important to note that the order of the parameters on the Facebook template should be followed exactly, and that the parameters flow from the top to the bottom. So if the Header contains 1 parameter, and the Body 2 parameters, then the Header parameter should be at position 0 in the whatsapp_template_params_array and the 2 Body parameters should be at position 1 and 2. If there are additional Button parameters, they should follow the other parameters.

Default: null


params.template.whatsapp_template_params

required
object

This object is used to dynamically enter named values for parameters, as they are set up on your Facebook template. Before this key-value parameter object can be used, it has to be configured on your Whatsapp Profiles page on Stubber Manage and allows for better readability in your process.

Example of how this can be used:

If your template on Facebook contains a Header and Body as below:

Header:

        Hi {{1}}

      

Body:

        {{1}} would like to interact with you on Whatsapp.
Subject : {{2}}

To allow interaction please click "Allow".

      

Then you can configure the whatsapp_template_params on your Whatsapp Profiles page such that the values can be substituted as:

loading...

Default: null


Result

Examples