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
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
required string
message_type 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:
required object
params 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.
Show child attributes
required object
template Object is required if the message_type
is template. This object should change to match what message_type
is set to.
Show child attributes
required string
whatsapp_template_name The name of the preconfigured Whatsapp template. This name should match the name of the template on Facebook.
optional array
whatsapp_template_params_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:
Body:
Then values can substituted as follows:
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.
optional object
whatsapp_template_params 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:
Body:
Then you can configure the whatsapp_template_params
on your Whatsapp Profiles
page such that the values can be
substituted as: