我在后保存解析云代码功能中发送短信。 我想和它一起发送图像。
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);
}
}
);
我没有收到任何错误。消息传递得很好,URL显示在正文中并且可以点击(链接到图像),但图片不会显示在消息中。
非常感谢任何帮助。谢谢!
更新
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);
}
}
);
通过上述更改,我收到此错误:
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'
答案 0 :(得分:0)