Build Facebook Messenger . ChatBot|Elixir Experts|#5
Coding Message Templates
Published in
5 min readJul 3, 2022
This article comprises coding of different message templates that enrich our conversation between the two parties by sending text messages integrating lists, images, buttons etc.
This message templates helps to convey the page owner ideas clearly to the person recipient.
Let’s go
Button Templates
Until now, we coded only text template and we are going to code button template soon. Facebook provides a button structure.
For an example this is how the postback button structure looks, directly copied from here
{
"recipient":{
"id":"<PSID>"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"Try the postback button!",
"buttons":[
{
"type":"postback",
"title":"Postback Button",
"payload":"DEVELOPER_DEFINED_PAYLOAD"
}
]
}
}
}
}