Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Sending a Messenger template message
function sendGenericMessage(sender, data) {
messageData = data;
url: '',
qs: {access_token:token},
method: 'POST',
json: {
recipient: {id:sender},
message: messageData,
}, function(error, response, body) {
if (error) {
console.log('Error sending messages: ', error)
} else if (response.body.error) {
console.log('Error: ', response.body.error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment