MargeTAgs of MailChimp in Mandrill

620 views
Skip to first unread message

Waheed Ul Haq

unread,
May 7, 2012, 6:56:29 AM5/7/12
to mandrill-a...@googlegroups.com
Hi,

Can we use the marge tags of MailChimp in Mandrill ???

Thanks..

Loren Norman

unread,
May 7, 2012, 4:26:10 PM5/7/12
to mandrill-a...@googlegroups.com
No, don't make any assumptions about Mandrill's templating system based on your knowledge of MailChimp's: it doesn't work the same way.

That said, we're overhauling Mandrill's templating system in light of some interesting use cases that our users have brought to our attention, so we'll be announcing all of that soon and we'll write a guide explaining how it all works.

Until then, the send-template API call has the most up-to-date information about what you can do:

noraz123

unread,
May 23, 2012, 5:36:03 PM5/23/12
to mandrill-a...@googlegroups.com
Thanks for the help here.

Is there a way to do any tags or merging of data with Mandrill templates?  For example, I want to create a template where I can pass in the first name, and have that populated.  I am guessing that the  *|FNAME|* doesn't work, because that is a MailChimp merge tag.

But is there anyway I can put in some tag, and specify it in the template_content struct that I can pass in the send-template call?

Loren Norman

unread,
May 23, 2012, 5:50:55 PM5/23/12
to mandrill-a...@googlegroups.com
Merge tag support in Mandrill is live now, and you can see the docs for it in the send-template API call now:

So you can use a merge tag of your choosing, and the set it in the API call via either the global_merge_vars or merge_vars variable. The global option will set a dynamic part for all recipients. The latter one is a per-recipient merge var that allows you to specify which recipients get which dynamic replacements.

The template_content struct is a different type of dynamic replacement, and it generally operates at the dom/template level. You specify it like this:

<div mc:edit="my_content_region">Some default content.</div>

Now you can leverage the template_content struct to replace the CONTENTS of that div tag (nothing in the tag itself, just the contents) with anything you want. You'd specify the name as "my_content_region" and the content as whatever you would like to appear inside the tag.

It is up to you which style is easier or more appropriate for you, but generally we think of the mc:edit regions as template-level replacements (perhaps you want to change out large portions of HTML?) and the merge tags are more for copy-level replacements (names, dates, etc).

Let us know if we can be of further assistance.

noraz123

unread,
May 23, 2012, 5:55:45 PM5/23/12
to mandrill-a...@googlegroups.com
Thanks for the fast reply!  Just what I was looking for.  Didn't realize "merge_vars" was what I needed.  Shame on me. 

Very excited about Mandrill.  Ton of potential, already saving us time.

Alain Adler

unread,
Jun 25, 2012, 11:10:44 AM6/25/12
to mandrill-a...@googlegroups.com
Hi, 
I'm new to mailchimp (and mandrill),
Can you give an example of how to use the merge_vars?
How do they look like on the template? Can I just add to the template "*|crazy_custom_var|*" and then mandrill will replace it with what I send in the json? Or do I have to configure each merge_var in a mailchimp list?

Kaitlin

unread,
Jul 2, 2012, 2:11:24 PM7/2/12
to mandrill-a...@googlegroups.com
Yes, that's generally how they work.  Avoid using colons in your custom merge tag (so nothing like *|LIST:ADDRESS|* for example). When you make the API call, you'll specify global values using global_merge_vars and recipient-specific values using merge_vars.  In the example you gave, the merge_var name is crazy_custom_var so you'll use that in the API call.

Mandrill doesn't have a concept of lists, and you don't need MailChimp to use  Mandrill, so no configuration needed for Mandrill.  If you're using merge tags in your MailChimp list, then yes, you'll need to configure each one beforehand.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages