gpt4 book ai didi

mailchimp - 为什么Mandrill无法识别我的合并标签?

转载 作者:行者123 更新时间:2023-12-03 15:16:14 25 4
gpt4 key购买 nike

我正在使用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|*

最佳答案

因为每次替换都需要两个字段:其名称和内容。因此,您的合并应如下所示:

"vars": [
{
"name": "name",
"content" : "merge2"
}
]

关于mailchimp - 为什么Mandrill无法识别我的合并标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17263870/

25 4 0