问题1:在定义文档中提到的X-SMTPAPI头相关顺序时,我是否需要严格遵守顺序?
文档(http://sendgrid.com/docs/API_Reference/SMTP_API/)这样提到它:
{
"to": [
"ben@sendgrid.com",
"joe@sendgrid.com"
],
"sub": {
"%name%": [
"Ben",
"Joe"
],
"%role%": [
"%sellerSection%",
"%buyerSection%"
]
},
"section": {
"%sellerSection%": "Seller information for: %name%",
"%buyerSection%": "Buyer information for: %name%"
},
"category": "Orders",
"unique_args": {
"orderNumber": "12345",
"eventID": "6789"
},
"filters": {
"footer": {
"settings": {
"enable": 1,
"text/plain": "Thank you for your business"
}
}
}
}
So, my email header in this case would look like the following in coldfusion:
<cfset myheaderdefinition = XMLFormat('X-SMTPAPI|{
"to": [
"ben@sendgrid.com",
"joe@sendgrid.com"
],
"sub": {
"%name%": [
"Ben",
"Joe"
],
"%role%": [
"%sellerSection%",
"%buyerSection%"
]
},
"section": {
"%sellerSection%": "Seller information for: %name%",
"%buyerSection%": "Buyer information for: %name%"
},
"category": "Orders",
"unique_args": {
"orderNumber": "12345",
"eventID": "6789"
},
"filters": {
"footer": {
"settings": {
"enable": 1,
"text/plain": "Thank you for your business"
}
}
}
}
') >
问题 #2:我定义标题的方式看起来不错吗?
关于问题 #1 的更多说明:
1.1 我是否需要按照上述相同的顺序使用 to、sub、role、section 等?或者,如果我不使用这些,我可以跳过其中一个吗?
1.2 我如何确定 sendgrid 对 unique_args 和其他字段的期望?