Venki8
Venki8

Reputation: 21

Mandrill is not replace merge tag content in html template

     Mandrill API Logs  -- 

"subject": "Valentine’s Day special offer. Additional 10% off* on select categories! View exclusive online offer",
        "from_email": "[email protected]",
        "from_name": "zipp",
        "to": [
            {
                "email": "[email protected]",
                "name": "venk",
                "type": "to"
            }
        ],
        "merge": true,
        "merge_vars": [
            {
                "rcpt": "[email protected]",
                "vars": [
                    {
                        "name": "UNSUB",
                        "content": "http://zyr.com/unsubscribe/GYT786HHG"
                    },
                    {
                        "name": "FirstName",
                        "content": "venk"
                    }
                ]
            }
        ],

    "async": false,
    "ip_pool": null,
    "send_at": null,

And when I click on the unsubscriber link in the template, it takes me to the url http://*|unsub|*. Mandrill is not replacing |UNSUB| with http://zyr.com/unsubscribe/GYT&786HHG. Please help me . I spent a lot of time on it, but am unable to solve it

                <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;" class="mcnTextContentContainer">
                    <tbody><tr>

                        <td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right: 18px; padding-bottom: 9px; padding-left: 18px;">

                            You can&nbsp;<a href="*|UNSUB|*" target="_blank">unsubscribe</a><br>
<br>
&nbsp;
                       </td>
                    </tr>
                </tbody></table>
            </td>
        </tr>
    </tbody>
</table>

Upvotes: 2

Views: 1365

Answers (1)

terrorbox
terrorbox

Reputation: 709

There's no need to pass in UNSUB as a merge variable. Mandrill takes care of all of that for you. UNSUB is a reserved merge tag too, which is why it's not being replaced with the value you pass in your API call.

So in your API call, remove the merge var altogether:

 {
                    "name": "UNSUB",
                    "content": "http://zyr.com/unsubscribe/GYT786HHG"
                },

And in your HTML template, use this instead:

You can&nbsp;<a href="*|UNSUB:http://zyr.com/unsubscribe/GYT786HHG|*" target="_blank">unsubscribe</a><br>

Upvotes: 2

Related Questions