-
-
Notifications
You must be signed in to change notification settings - Fork 192
Messenger Template node
The Messenger Template node
is used to send any of the supported template in Facebook Messenger:
- Generic template
- Button template
- Media template
- Product template
- Receipt template
- Customer Feedback Template
For the last two templates it's not available an advanced UI, just a JSON editor where to copy and paste the payload for the desired template (read the Facebook documentation about how to generate it).
Two generic templates can be combined together in a carousel by simply chaining Messenger Template node
(to maximum of 10). Each template can have a maximum of 3 buttons, title
and subtitle
are limited to 80 chars.
Generic templates and button template can have up to 3 buttons, see Buttons node
for a complete list of available buttons (only quick-reply
and location
are not available here).
In order to create a generic template in a upstream Function node
msg.payload = {
templateType: 'generic',
title: 'my title',
subtitle: 'I am a sub title',
imageUrl: 'http://image.server.com/cover.png',
buttons: [
{
type: 'url',
url: 'http://javascript-jedi.com',
label: 'Javascript Jedi'
}
]
}
or in order to pass a collection of elements for the carousel
msg.payload = {
elements: [
{
templateType: 'generic',
title: 'my title',
subtitle: 'I am a sub title',
imageUrl: 'http://image.server.com/cover.png',
buttons: [
{
type: 'url',
url: 'http://javascript-jedi.com',
label: 'Javascript Jedi'
}
]
},
{
templateType: 'generic',
title: 'another title',
subtitle: 'Second sub title',
imageUrl: 'http://image.server.com/cover2.png',
buttons: [
{
type: 'url',
url: 'http://javascript-jedi.com',
label: 'Javascript Jedi'
}
]
}
]
}
Some additional parameters can like shareable or aspectRatio can be defined using the Params node
.
Available parameters for the msg.payload
Name | Type | Description |
---|---|---|
templateType | string | Could be: generic, button, customer_feedback, media or product |
title | string | Title of the list element (for generic templates) |
subtitle | string | Sub title of the list element (for generic templates) |
imageUrl | string | Url of the image element (for generic templates) |
buttons | array of [button] | Array of buttons, see Buttons node for more details (for generic or button templates) |
mediaUrl | string | Url of the media element (for media templates) |
mediaType | string | Type of media element, can be video or image (for media templates) |
attachmentId | string | Facebook attachment id (for media templates) |
productId | stgring | Facebook product id (for product templates) |
The [element]
object|
Name | Type | Description |
---|---|---|
title | string | Title of the generic template element |
subtitle | string | Sub title of the generic template element |
imageUrl | string | Url of the generic template image |
buttons | array of [button] | Array of buttons, see Buttons node for more details |