Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mailchimp template export to mandrill issue with merge tags

I have made templates in Mailchimp and would like to export them to Mandrill, so it can be automated when a new user signs up on our website, as a Welcome email and Getting Started email.

In the Mailchimp template, I have added the mc:edit="name" in the html as my mandril JSON looks for the name tag to personalise. Code is below

<p>Hi <span mc:edit="name">&nbsp;</span></p>

When I Send to Mandrill and view the source code, it ignores the mc:edit tag and shows this below

<p>Hi <span></span></p>

However, when I manually change the mandrill template to include the mc:edit, the personalisation works.

Is there some setting that I need to add in Mandrill (or Mailchimp) for this to work? It is really cumbersome to modify the mandrill template all the time because as we make changes to the mailchimp template, the mc:edit gets overridden as soon as I export it.

like image 651
Chou One Avatar asked Jan 26 '15 06:01

Chou One


People also ask

Why is MailChimp merge tag not working?

If it still seems like merge tags aren't working, try to send a test email to yourself or a small test segment. Be sure your test email accounts have default values for each merge value in your campaign, and segment your audience to send to only these test addresses.

How do I enable live merge tags in MailChimp?

Click the Settings drop-down and choose Audience fields and *|MERGE|* tags. Click Add A Field and choose Text. Input a field label, like PDF Links. Uncheck the Visible box next to the new field so it won't appear on your signup form.

Can you export MailChimp template as HTML?

Click Campaigns. Click Email templates. Locate the template you'd like to export by browsing the template list or using the search option. Click the drop-down menu next to the Edit button and choose Export as HTML.


1 Answers

In my MailChimp template I use the following format to specify merge tags (named name and product):

<p>Hi *|name|*!</p>
<p>Thanks for downloading *|product|*.</p>

You will have to authorize MailChimp to access your Mandrill account. Assuming you have already done this, you shoud send your MailChimp template to Mandrill. You do this from the Templates page: click the Down arrow on the Edit button and select 'Send to Mandrill'. You should now see your template in you Mandrill account on the Outbound -> Templates page.

Assuming that you want send a new transactional message through Mandrill using a template, then you POST the following JSON to https://mandrillapp.com/api/1.0/messages/send-template.json:

{
    "key": "***apikey***",
    "template_name": "name-of-your-template",
    "template_content": [],
    "message": {
        "subject": "Thanks for downloading",
        "from_email": "[email protected]",
        "from_name": "yourcompany",
        "to": [
            {
                "email": "[email protected]",
                "name": "John",
                "type": "to"
            }
        ],
        "merge": true,
        "merge_language": "mailchimp",
        "global_merge_vars": [
            {
                "name": "name",
                "content": "John"
            },
            {
                "name": "product",
                "content": "Awesome 1.0"
            }
        ]
    }
}
like image 128
Frank Avatar answered Nov 15 '22 05:11

Frank