2
我試圖通過curl使用帶有JSON和PHP的Mandrill API發送電子郵件。我可以發送基於文本的電子郵件和基本的HTML格式,但是當我嘗試從PHP發送模板時,它不起作用。 但是,將我的JSON帖柱複製並粘貼到Mandril API頁面(https://mandrillapp.com/api/docs/messages.html)時,它可以正常工作併發送!我是否缺少網站添加的內容?使用API從Mandrill發送模板電子郵件爲空
{
"key": "XXX",
"template_name": "temp-name",
"template_content": [
{
"name": "example name",
"content": "example content"
}
],
"message": {
"subject": "Welcome to our website",
"from_email": "[email protected]",
"from_name": "name",
"to": [
{
"email": "[email protected]",
"name": "name"
}
],
"important": false,
"track_opens": true,
"merge": true,
"global_merge_vars": [
{
"name": "merge1",
"content": "merge1 content"
}
],
"merge_vars": [
{
"rcpt": "[email protected]",
"vars": [
{
"name": "merge2",
"content": "merge2 content"
}
]
}
],
"tags": [
"invite-send"
]
},
"async": false,
"ip_pool": "Main Pool"
}