FYI: Example for using merge tags

For anyone interested, here is a rudimentary example of one way to structure your call to wpMandrill in order to use merge tags in Mandrill/MailChimp templates.

Let’s say you have the merge tags *|firstname|*, *|lastname|*, and *|activationkey|* in your email template. Now you want to populate those tags with variables from WordPress. You need to pay attention to the structure of the $global_merge_vars and $merge_vars arrays. Here is an example with the merge vars set for one recipient. For multiple recipients, you’ll have to set up a loop of some sort to pre-populate your global_merge_vars and merge_vars arrays with the values for each recipient :

MC_Will: Great plugin. The documentation and comments in the source could be more clear regarding the structure of some of the expected arrays. It took looking at the API and the JSON string format to realize that the merge arrays, for example, aren’t a simple one-dimensional array.