使用sendgrid XSMTPAPI标头在邮件中提供退订链接 [英] To give unsubscribe link in the mail using sendgrid XSMTPAPI header
问题描述
任何人都可以告诉我如何通过修改标头在发送的邮件中添加退订链接.我使用的是Sendgrid标头XSMTPAPI,尽管我在过滤器中找到了一个名为订阅跟踪"的相关标头,但找不到图了解如何使用它.
Can any one please tell me how to add unsubscribe link in the mail which is send by modifying the header.I am using Sendgrid header XSMTPAPI, although I found a relevant header called subscription track in the filters, but couldn't figure out how to use it.
推荐答案
您希望拥有一个X-SMTPAPI
标头,当出现该标头时,它看起来像这样:
You would want to have an X-SMTPAPI
header that looked something like this when broken out:
{
filters: {
subscriptiontrack: {
settings: {
enable: 1,
"text/html": "Unsubscribe <%Here%>",
"text/plain": "Unsubscribe Here: <% %>"
}
}
}
}
发送请求时,请确保将标头的JSON字符串化:
When you're sending the request, make sure you stringify the JSON for the header:
X-SMTPAPI: '{"filters":{"subscriptiontrack":{"settings":{"enable":1,"text/html":"Unsubscribe <%Here%>","text/plain":"Unsubscribe Here: <% %>"}}}}'
此外,请注意,所有这些都可以在文档页面上的X-SMTPAPI
标头上找到:
Also, as a side note, all of this can be found on the docs page for the X-SMTPAPI
header:
- http://sendgrid.com/docs/API_Reference/SMTP_API/index.html
- http://sendgrid.com/docs/API_Reference/SMTP_API/apps.html
- http://sendgrid.com/docs/API_Reference/SMTP_API/index.html
- http://sendgrid.com/docs/API_Reference/SMTP_API/apps.html
这篇关于使用sendgrid XSMTPAPI标头在邮件中提供退订链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!