繁体   English   中英

在通过 Sendgrid 的 API 发送的 html email 中的动态文本中添加换行符

[英]Add line breaks to dynamic text in an html email sent via Sendgrid's API

我在我的 HTML email 中插入动态文本,该文本具有编号和后续换行符。 SendGrid 标记是: {{insert emailData.data.copy3 'default=' }}我插入的文本如下所示:

The attached proposal covers the following:
 
1. Overview
2. How the Fund contributes to systemic change

Please indicate  your acceptance by clicking on this button

但是,它在我的 email 中显示如下:

The attached proposal covers the following: 1. Overview 2. How the Fund contributes to systemic change Please indicate  your acceptance by clicking on this button

请协助,以便我的换行符正确显示。

在 HTML 中,超出单词之间的空格的空格被渲染引擎忽略。 您需要使用 HTML 布置文档以使其正确呈现。

对于您的 email 副本,要使其看起来像您希望的那样,您需要包含 HTML 以进行布局。 这应该有效:

<p>The attached proposal covers the following:
<ol>
  <li>Overview</li>
  <li>How the Fund contributes to systemic change</li>
</ol>
<p>Please indicate your acceptance by clicking on this button</p>

如何生成此 HTML 取决于您。 例如,您可以通过 markdown 解析器运行您的原始文本,并从该文本生成 HTML。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM