我正在为Twilio(SMS)频道构建一个机器人。当我向美国的某个号码发送简单的普通短信时,它会在twilio消息日志中以Delivered
的形式发送。
但是当我将任何图像附加到邮件上以发送彩信时,邮件永远不会被传递,并且它在twilio日志中的状态始终为sent
。
以下是我将媒体附加到彩信的方式。
var msg = new builder.Message(session);
msg.attachmentLayout(builder.AttachmentLayout.list)
msg.attachments([
new builder.HeroCard(session)
.title("This is Title")
.subtitle("This is sub title")
.text("This is text")
.images([builder.CardImage.create(session, 'http://www.readersdigest.ca/wp-content/uploads/2011/01/4-ways-cheer-up-depressed-cat.jpg')])
]);
session.send(msg).endDialog();
我还使用另一种方式构建消息:
var msg = new builder.Message(session)
.text("This is a title - which can be long and multiple line sometimes<br/><br/>The body of the text can be really really long sometimes with different formats with links <http://google.com|Google><br/><br/>some times with a footer with `formats`")
.addAttachment({
contentUrl: 'http://www.readersdigest.ca/wp-content/uploads/2011/01/4-ways-cheer-up-depressed-cat.jpg',
contentType: 'image/png',
name: 'BotFrameworkOverview.png'
});
这两条消息永远不会被传递。
但是没有媒体的简单消息成功传递为 -
var msg = new builder.Message(session)
.text("This is a title - which can be long and multiple line sometimes<br/><br/>The body of the text can be really really long sometimes with different formats with links <http://google.com|Google><br/><br/>some times with a footer with `formats`")
Twilio Log: