Build Facebook Messenger . ChatBot|Elixir Experts|#5

Coding Message Templates

Malreddy Ankanna
blackode

--

cover photo

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"
}
]
}
}
}
}

--

--

Malreddy Ankanna
blackode

Programmer & Writer, I write about coding, thoughts, ideas, personal musings, technical articles, and tutorials.https://bio.link/blackode