我正在使用Mandrill API,并有一个简单的模板:
<html>
<body>
<p>Hello *|name|*
</p>
</body>
</html>
我正在使用这里的send-template.json API: https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template
当我插入我的有效载荷时,“name”变量仍未填充,有任何想法吗?
{
"key": "secret",
"template_name": "mandrill-sunday",
"template_content": [
{
"name": "example name"
}
],
"message": {
"html": "<p>Example HTML content</p>",
"text": "Example text content",
"subject": "example subject",
"from_email": "message.from_email@example.com",
"from_name": "Example Name",
"to": [
{
"email": "myemail@gmail.com",
"name": "Recipient Name"
}
],
"headers": {
"Reply-To": "myemail@yahoo.com"
},
"important": false,
"track_opens": null,
"track_clicks": null,
"auto_text": null,
"auto_html": null,
"inline_css": null,
"url_strip_qs": null,
"preserve_recipients": null,
"bcc_address": "kamil@myemail.com",
"tracking_domain": null,
"signing_domain": null,
"merge": true,
"global_merge_vars": [
{
"name": "merge1"
}
],
"merge_vars": [
{
"rcpt": "myemail@gmail.com",
"vars": [
{
"name": "merge2"
}
]
}
],
"tags": [
"password-resets"
],
"google_analytics_domains": [
"mydomain.com"
],
"google_analytics_campaign": "mandrill-sunday",
"metadata": {
"website": "www.mydomain.com"
},
"recipient_metadata": [
{
"rcpt": "myemail@gmail.com",
"values": {
"user_id": 123456
}
}
]
},
"async": false
}
但我在发出的电子邮件中只收到了如下回复:
Hello *|name|*