Message Template List not rendering


(Tabish Khan) #1

Hi,
I am trying to display list from the document JSON


all i get is that JSON is displayed back raw.
image

Examaple JSON (putting only element in JSON) below:
var message =
{
“type”: “template”,
“payload”: {
“template_type”: “list”,
“elements”: [
{
“title”: “Classic T-Shirt Collection”,
“image_url”: “https://peterssendreceiveapp.ngrok.io/img/collection.png”,
“subtitle”: “See all our colors”,
“default_action”: {
“type”: “web_url”,
“url”: “https://peterssendreceiveapp.ngrok.io/shop_collection”,
“messenger_extensions”: true,
“webview_height_ratio”: “tall”,
“fallback_url”: “https://peterssendreceiveapp.ngrok.io/
},
“buttons”: [
{
“title”: “View”,
“type”: “web_url”,
“url”: “https://peterssendreceiveapp.ngrok.io/collection”,
“messenger_extensions”: true,
“webview_height_ratio”: “tall”,
“fallback_url”: “https://peterssendreceiveapp.ngrok.io/
}
]
}
],
“buttons”: [
{
“title”: “View More”,
“type”: “postback”,
“payload”: “payload”
}
]
}
}
print(JSON.stringify(message));


(Subrahmanyam Donepudi) #2

Hi @tabish13khan, please select a channel in this case so that the template will be rendered depending on whether the channel supports the template. If the message is set to be delivered to all channels, then the payload will be sent over to the channels.
In your case, the template type “list” is supported by the web/mobile client channel. So please select the same to apply channel specific override. Refer to the below snips for more details

image