【问题标题】:To give unsubscribe link in the mail using sendgrid XSMTPAPI header使用 sendgrid XSMTPAPI 标头在邮件中提供取消订阅链接
【发布时间】:2013-04-15 08:24:21
【问题描述】:

谁能告诉我如何在通过修改标头发送的邮件中添加取消订阅链接。我正在使用 Sendgrid 标头 XSMTPAPI,虽然我在过滤器中找到了一个名为订阅跟踪的相关标头,但无法计算了解如何使用它。

【问题讨论】:

    标签: jakarta-mail sendgrid


    【解决方案1】:

    您可能希望有一个X-SMTPAPI 标头,在拆分时看起来像这样:

    { 
      filters: { 
        subscriptiontrack: { 
          settings: { 
            enable: 1,
            "text/html": "Unsubscribe <%Here%>", 
            "text/plain": "Unsubscribe Here: <% %>" 
          } 
        } 
      }
    }
    

    当您发送请求时,请确保对标头的 JSON 进行字符串化:

    X-SMTPAPI: '{"filters":{"subscriptiontrack":{"settings":{"enable":1,"text/html":"Unsubscribe <%Here%>","text/plain":"Unsubscribe Here: <% %>"}}}}'
    

    另外,作为旁注,所有这些都可以在X-SMTPAPI 标头的文档页面上找到:

    【讨论】:

    猜你喜欢
    • 2016-03-10
    • 1970-01-01
    • 2012-12-02
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 1970-01-01
    • 2016-03-28
    • 1970-01-01
    相关资源
    最近更新 更多