Outlook 365 API中返回的HTML的setAsync和getAsync问题

时间:2018-10-11 18:46:42

标签: office-js outlook-web-addins

我们在修改发送给它的html的window.Office.context.mailbox.item.body.setAsync中遇到问题。具体是签名。

原始HTML传入此处:

window.Office.context.mailbox.item.body.setAsync(html, { coercionType: window.Office.CoercionType.Html }, (response) => {
    if (response.error) {
        console.error('setBody Error :', response.error);
        callback && callback(response.error);
    } else {
        callback && callback(null);
    }
});

包含签名中的图像,并且src看起来像这样: <img class="EmojiInsert" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2w...

但是,在将其传递给setAsync并调用window.Office.context.mailbox.item.body.getAsync('html', ...)之后, 立即,我们收到的回馈是: <img class="EmojiInsert" src="" 在签名中。

这仅适用于签名图像,电子邮件中附加的任何其他图像均会正确返回。

我们有没有做对的事情?

谢谢

1 个答案:

答案 0 :(得分:1)

为了安全起见,我们不支持直接通过SetAsync API附加图像。为了插入图像,您需要首先将其作为附件添加,并将isInline属性设置为true,然后使用src='cid:myImage.jpg'插入图像标签。查看教程here中的简单示例。

相关问题