我是否可以解决SendGrid中每个个性化块的替换限制为10000字节?

时间:2017-05-05 09:18:57

标签: sendgrid sendgrid-templates

我尝试使用事务模板发送包含SendGrid的电子邮件。这是对客户的订单确认,我想在此显示订单的一些基本信息以及订购商品列表。

由于SendGrid不支持发送项目数组并在事务模板中使用它们,因此我必须在我的应用中将它们翻译为HTML并提供完整的HTML替代{{articles}}

这样做很好,直到客户决定订购一大堆文章(如30行左右,具体取决于每行的样式),然后我收到此错误消息:

  

替换限于每个个性化块的10000字节

有人知道这方面的好工作吗?或者我应该只使用其他电子邮件服务(例如mailjet)?



<!DOCTYPE html>
<html>

<head>
</head>

<body>
  <div>
    <table border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td>
            <table>
              <tbody>
                <tr>
                  <th>Ordernumber:</th>
                  <td>{ordernumber}</td>
                </tr>
                <tr>
                  <th>Purchase identifier:</th>
                  <td>{purchaseidentifier}</td>
                </tr>
              </tbody>
            </table>
          </td>
        </tr>
        <tr>
          <td>
            <table>
              <thead>
                <tr>
                  <th>ID</th>
                  <th>Description</th>
                  <th>Quantity</th>
                  <th>Price</th>
                </tr>
              </thead>
              <tbody>
                <!--{{articles}}-->
              </tbody>
            </table>
          </td>
        </tr>
        <tr>
        </tr>
      </tbody>
    </table>
  </div>

</body>

</html>
&#13;
&#13;
&#13;

2017年10月更新: Github上有一个线程表明这个功能即将发布到SendGrid API。 https://github.com/sendgrid/sendgrid-nodejs/issues/221

1 个答案:

答案 0 :(得分:1)

由于您只向单个用户发送一封电子邮件,您是否可以在将其发送到SendGrid之前填充电子邮件正文中的所有内容,而不是使用替换?

相关问题