FB Messenger Message Template

穿精又带淫゛_ 提交于 2019-12-04 17:11:55

You can only add new lines to the message itself, not to titles or buttons or quick replies for ex

    messageData = { 
                    recipient: {id: recipientId},
                    message: {
                     text: "Your First Line \n your second line",
                     metadata:"DEVELOPER_DEFINED_METADATA"
                   }};
Itay Ben Ari

just add new element.

"message":{
   "attachment":{
      "type":"template",
      "payload":{
        "template_type":"generic",
        "elements":[
          {
            "title":"Classic T-Shirt",
            "image_url":"<link>",
            "subtitle":"Medium Grey %0D%0A s",
            "buttons":[
              {
                "type":"web_url",
                "url":"<link>",
                "title":"View details"
              },
              {
                "type":"postback",
                "title":"Buy Now!",
                "payload":"USER_DEFINED_PAYLOAD"
              }             
            ]
          },
          {
            "title":"Classic T-Shirt",
            "image_url":"<link>",
            "subtitle":"Medium Grey %0D%0A s",
            "buttons":[
              {
                "type":"web_url",
                "url":"<link>",
                "title":"View details"
              },
              {
                "type":"postback",
                "title":"Buy Now!",
                "payload":"USER_DEFINED_PAYLOAD"
              }              
            ]
          }
        ]
      }
    }
  }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!