In my MailChimp template, I use the following format to specify merge tags (name and product):
<p>Hi *|name|*!</p> <p>Thanks for downloading *|product|*.</p>
You will need to authorize MailChimp to access your Mandrill account. Assuming you have already done this, you are submitting 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 your Mandrill account at the Outbound โ Templates page.
Assuming you want to send a new transactional message via Mandrill using the template, you will send 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": " hello@yourcompany.com ", "from_name": "yourcompany", "to": [ { "email": " john@theircompany.com ", "name": "John", "type": "to" } ], "merge": true, "merge_language": "mailchimp", "global_merge_vars": [ { "name": "name", "content": "John" }, { "name": "product", "content": "Awesome 1.0" } ] } }
source share