My debugger keeps on sending me a callback error (see img link below) for this function. I also would like to continue from my function back to studio, the studio docs say I need "A successful return (HTTP 20X)" what am I missing
exports.handler = function(context, event, callback) {
const client = require('twilio')();
const msg = event.Msg;
client.messages
.create({
body: msg,
from: '+17322222222',
to: '+13477777777'
})
.then(message => console.log(message.sid));
};
if I insert callback() at end of code, I get a successful return but the message doesn't get sent then.
exports.handler = function(context, event, callback) {
const client = require('twilio')();
const msg = event.Msg;
client.messages
.create({
body: msg,
from: '+17322222222',
to: '+13477777777'
});
callback();
};