outlook-addin - 在 Outlook for Mac 与 OWA 中呈现组合电子邮件的方式之间的差异
问题描述
我正在尝试使用 body.setAsync(body, {coercionType: 'html'}) 使用生成的 HTML 电子邮件模板设置电子邮件正文。在 Outlook 桌面客户端 Mac、2016、2019)和 OWA 中呈现的内容之间存在明显差异。
是否有任何关于为不同客户提供一致体验的指导。是否有任何已知会导致 Outlook 桌面客户端呈现问题的 html 元素?
例如:电子邮件模板
<div>BEFORE HTML TAG</div>
<html style="overflow-y: hidden;">
<div>before head element</div>
<head>
<title>Title here inside head</title>
</head>
<div>after head element</div>
<body style="height: auto; min-height: auto;">OUTLOOK LIGHT IN BODY
<br />
<br />
Test Email with Subject formula
</body>
</html>
<tr>
<td>OUTLOOK LIGHT Footer
<br />
<br />
Test Email with Subject formula
<br />
<br />
</td>
</tr>
OWA 电子邮件正文:
BEFORE HTML TAG
before head element
after head element
OUTLOOK LIGHT IN BODY
Test Email with Subject formula OUTLOOK LIGHT Footer
Test Email with Subject formula
Outlook for Mac 电子邮件正文:
OUTLOOK LIGHT IN BODY
Test Email with Subject formula
Outlook for Mac HTML 使用 body.getAsync('html')
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
-->
</style>
</head>
<body lang=EN-US>
<div class=WordSection1>
<p class=MsoNormal>OUTLOOK LIGHT IN BODY<br>
<br>
Test Email with Subject formula</p>
<p class=MsoNormal> </p>
</div>
</body>
</html>
每个客户端中呈现的内容之间存在差异。
解决方案
OWA 和本机客户端之间的消息呈现引擎是不同的。Mac、Outlook 2016 和 Outlook 2019 都使用相同的渲染引擎,但是它们都有不同的版本,因为微软已经对其进行了迭代。我们不保证 body.getAsync 和 body.setAsync 是幂等的。. 客户端将强制传递的值以使其渲染效率和支持的保真度。请向我们的UserVoice添加一个请求,请求为 HTML 提供更一致的支持的正文 API。
推荐阅读
- rust - 在 Rust 中,堆栈上发生了什么,堆上发生了什么?
- javascript - Angular mat-select 在移动设备或低宽度设备上无法正确显示选项
- eigen - 求解稀疏欠定系统
- android - 清单中 supportRTL false 的 setMarginStart 的奇怪行为
- firebase - 错误:程序类型已存在:com.google.firebase.auth.UserInfo
- shopify - 当产品有变量时,如何在“添加到购物车”中显示“选择您的选项”?
- vuejs2 - 如何在 VueJS 中将 HTML 转换为不同的类型?
- python - 如何使用 python 3 查找损坏的 mp3 文件?
- python - 在 python 未知伪标签中打开 TIFF 时出错
- python - 使用 Numpy,计算大小为 10 的向量与大小为 (5, 10) 的矩阵中的每一行的内积的最佳方法是什么?