我正在使用 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
当我插入有效负载时,仍然没有填充“名称”变量,知道为什么吗?
{
"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|*