Mandrill sending to multiple people as separate message via the REST API

拈花ヽ惹草 提交于 2019-12-20 20:37:52

问题


I'm trying to send out mails using mandrill. The problem is that when I add multiple recipients to the 'to' parameter, it sends out the same mail multiple times with ALL the recepients in the 'to' list. I was expecting the same mail to be sent out individually to every person in the to list. Am I missing something ?

{
    "key": "app-key",
    "template_name": "platform-invite",
    "template_content": [
        {
            "name": "connection",
            "content": "<a class=\"mcnButton \" title=\"Lets Go\" href=\"http://someurl\" target=\"_blank\" style=\"font-weight: normal;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;\">Lets go</a>"
        },
        {
            "name": "mailbody",
            "content": "<p>Hi </p>\n<p>I would like you to be a ... Tic tic tic...</p>"
        }
    ],
    "message": {
        "subject": "My subject line over herer",
        "from_email": "superman@mydomain.co",
        "to": [
            {
                "email": "person1@gmail.com,
                "type": "to"
            },
            {
                "email": "person2@gmail.com",
                "type": "to"
            },
            {
                "email": "person3@gmail.com",
                "type": "to"
            },
            {
                "email": "person4@gmail.com",
                "type": "to"
            }
        ],
        "merge_vars": {}
    },
    "async": false,
    "ip_pool": "Main Pool"
}

回答1:


There's an option in your Sending Options to expose recipients to one another. You can uncheck that box to not show everyone's information in the 'to' header. The option(s) you select in the Sending Options are used by default for your account. You can override any of these options in individual API calls. In this case, you could use the preserve_recipients parameter to override the current default that's set for your account.



来源:https://stackoverflow.com/questions/24638014/mandrill-sending-to-multiple-people-as-separate-message-via-the-rest-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!