I am sending an sms message in an after save parse cloud code function. I would like to send an image along with it.
var twilio = require('twilio')("***************","*****************");
twilio.sendSms({
to: "+1234567890",
from: "+1234567890",
body: url,
mediaUrl: url
}, function(err, responseData) {
if (err) {
console.log(err);
} else {
console.log(responseData.from);
console.log(responseData.body);
}
}
);
I'm not getting any errors. Messages are delivered nicely, URL shows in body and is clickable (links to image), but the picture does NOT show up in the message.
- Yes, my account has MMS capabilities.
- No, those are not the actual numbers I have in my code.
- Yes, my to number is verified.
- Yes, I am able to receive MMS with picture when using twilio's API Explorer interface.
Any help is greatly appreciated. Thanks!
UPDATE
twilio.sendMessage({
to: "+12672574729",
from: "+12013807380",
body: url,
mediaUrl: url
}, function(err, responseData) {
if (err) {
console.log(err);
} else {
console.log(responseData.from);
console.log(responseData.body);
}
}
);
With the above change, I'm getting this error:
Input: {"object":{"Picture":{"__type":"File","name":"tfss-36cd9d55-e561-45ec-b65b-a04f872cb37d-alarm_9132015_00_sm.jpg","url":"http://files.parsetfss.com/104aa614-342a-4c1e-8c67-b7718c3e6325/tfss-36cd9d55-e561-45ec-b65b-a04f872cb37d-alarm_9132015_00_sm.jpg"},"createdAt":"2015-09-23T00:26:05.333Z","objectId":"vYeP2YYVEg","updatedAt":"2015-09-23T00:26:05.333Z"}}
Result: TypeError: Object [object Object] has no method 'sendMessage'