【发布时间】:2019-04-02 20:12:45
【问题描述】:
我正在尝试使用带有旧模板的替换来发送电子邮件。一些替换是 URL,我想使用标签显示。我的问题是,href 属性中的所有内容都在不应该输出的时候被输出。
例如,这是我的电子邮件模板中的一行。
<a href="-acceptUrl-">Follow this link</a> to accept the invitation and get started.
在电子邮件中输出以下内容(在 Gmail 中接收):
点击此链接http://www.website.com 接受邀请并开始使用。
SendGrid 中的 WYSIWYG 显示正确的格式:
另一个例子是当我尝试显示 URL 本身并使其可点击时:
Twitter: <a href="-twitterUrl-">-twitterUrl-</a><br />
这是我在 Gmail 中收到的:
推特:http://twitter.com/xxxhttp://twitter.com/xxx
以及正确的格式:
【问题讨论】:
-
您是否正在查看邮件的明文正文?如果是这样,SendGrid 可能会在此处添加 URL 以供直接单击,但它实际上不是 HTML。如果您在 GMail 中“显示原始”,您可以看到原始正文,并查看实际执行的操作。
-
@jacobmovingfwd 实际上我不认为我正在查看纯文本正文。我在“显示原始”查看器中看不到任何 HTML……我完全看到了这一点:
Follow this link http://www.website.com to accept the invitation and get started. -
实际上现在我不知道发生了什么,但我收到了这个:
Follow this link ( http://www.website.com ) to accept the invitation and get started.和括号。 HTML 没有改变。我可能要疯了。
标签: sendgrid sendgrid-templates