使用Outlook桌面时剥离SetSelectedDataAsync Html数据

问题描述

我正在尝试从Outlook Web加载项向Outlook电子邮件中添加隐藏数据,以便以后可以将其用于将电子邮件链接回其他数据。

我正在这样使用setSelectedDataAsync方法:

var content = 
              "<input type=\"hidden\" id=\"hidEmailTracking\" value='{\"syntheticConversationId\":\"" 
              + syntheticConversationId + "\"" +
              ",\"staffId\":" + staffId +
              ",\"countryCode\":\"" +  countryCode + "\"}'/>";

              item.body.setSelectedDataAsync(
                content,{coercionType: Office.CoercionType.Html},function (result) {

但是,当我发送电子邮件时,Outlook Web会保留我添加的隐藏字段,但是Outlook Desktop似乎会将其删除。电子邮件已设置为HTML格式。

有没有办法标记隐藏的html,以便不会将其删除?或者,是否有另一种方式可以在与Outlook Web和台式机兼容的Outlook电子邮件中传输隐藏数据?

谢谢

解决方法

我们有一个互联网标头API,可用于实现您的方案。这里的文档:https://docs.microsoft.com/en-us/javascript/api/outlook/office.internetheaders?view=outlook-js-preview

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...