Calling all MailChimp users

Anyone out there using MailChimp? Or would like to use it for maintaining subscriber lists? Would you be interested in trying a beta plugin for allowing visitors to very easily subscribe / unsubscribe from your lists, that gives you virtually unlimited control over the signup process? If so, please raise your digital paw here and I’ll send you something to evaluate.

A bit of background for the interested: this plugin is merely a smidgeon of glue that links the new version of zem_contact_reborn (v4.5.0.0) with MailChimp using a tiny library written by none other than former Textpattern genius Drew McLellan. In true smd stylie, the basis of the plugin is that you can do… well, pretty much anything with the MailChimp API, by using ZCR tags to control it.

You can also control how the plugin interacts with ZCR when it returns. By default it’ll skip the mail process (because you may ask MailChimp to send a welcome message if you prefer), but if you want it to send you a confirmation of subscription or you want to copysender then it’ll do that too. With ZCR’s new bodyform attribute you have more control over the output, as well as being able to intercept the mail process itself and reformat it (maybe even do HTML emails if that’s your thing).

The plugin defaults to calling lists/subscribe, but you can change that by specifying another secret key with the mailchimp_action you wish the plugin to perform. Pass in whatever fields you need to fulfil that request and then when anyone interacts with the form, it does your bidding.

Since the thing is currently only designed for subscribe / unsubscribe actions (which don’t return anything) I’ve yet to figure out how to handle any data that MailChimp returns. If I figure that out, you could even go as far as adding ZCR forms to a hidden area of your site to make your own MailChimp management system (fetch lists, show subscribers to lists, etc). For now that’s not possible, but maybe soon.

As I say, it’s experimental, but for anyone who wants to use their Textpattern site to capture subscriber details, this may be just the ticket as a first step to engaging with customers.

Re: Calling all MailChimp users

Why would we use a plugin for contact forms as a sign-up form for a third-party service

You’re right that mem_form is more general purpose and could indeed be used instead. Aside from the fact I don’t care for it much (it just always seems to cause more problems than it solves and I don’t have the mettle to brave the code and fork it!) this is just part one of an experiment into bolt-on modules that can do additional stuff when a user submits something to a site.

Contact forms that send email are one way of initiating dialogue with customers. I see ZCR as more than just an email portal, and kinda figured (rightly or wrongly) that it was under its remit to be able to open up a channel of communication outside of plain email.

ZCR can send articles and was used as the backbone of the first, rather flawed, Postmaster implementation. I just took that spirit and hacked together a tiny extension that delivered “email” somewhere other than someone’s inbox.

The efficacy of this is open to interpretation. Maybe nobody will bite. Maybe it’ll just be crap and I’ll ditch it. Who knows. But there’s a delivery callback in ZCR begging to be used, I wanted to play, and it took about an hour to write (including the docs) so I figured it was worth the effort.

how do you discern between these two use cases?

The existence of the secret tags beginning with mailchimp_ cause the plugin to do something. Otherwise it stays quiet and lets you mail as normal.

Re: Calling all MailChimp users

As an addendum to my previous post that I wrote in a rush, here are my reasons for choosing ZCR as the delivery platform, instead of mem_form:

ZCR supports HTML 5 widgets and has a more generic set of tags. Granted mem_form does have the combi tags for select and category lists, which is a nice feature.

Redirection in mem_form can be hit and miss, and sometimes just returns “You have successfully submitted the form. Thank you.” when you want it to do something else.

ZCR supports Textpacks and is more l10n-aware.

ZCR is currently supported and has more in-depth documentation. And a fair number of people are comfortable with the syntax of creating a contact form compared with mem_form.

Modules such as smd_mailchimp hook into the delivery phase of ZCR. Signalling back to the plugin allows the built-in mailing feature to be augmented or overridden, but it’s there for free if you wish.

A contact form creates a bond between your site and your visitors. I wanted to capitalise on that notion and build upon it. Other plugin modules could take ZCR content, validate it and present it to any number of places, e.g. social media sites or comment systems. And as mentioned, site admins can get a notification about the content if they choose.

ZCR just feels more solid in use and has a more well-rounded set of defaults because of its focus on message delivery. Convention over configuration.

I like that mem_form has a callback per field: that’s neat, though probably overkill for ZCR. A single delivery callback is probably enough for modules to decide if they need to intervene. At least for now.

ZCR is fairly mature now and a stable platform to work from. As a simple glue concept, the MailChimp plugin works. It could go a lot further, but probably won’t. I thought about allowing you to set and store your API key(s) from the admin side, maybe offering some handy subscribe / unsubscribe tags, but I opted for the path of least resistance / lowest common denominator and left it up to the admin to decide how to build the form. That does mean you could do some daft things, as hinted in the first post, but I wouldn’t advocate them even though they’re allowed!

Oh, and this is why I chose to try this out using MailChimp instead of any one of the other eight million offerings in the arena:

It has a free account option with sensible limits.

It’s powerful and flexible enough for modest campaigns to succeed.

The API is clean and logical… err, mostly.

It doesn’t ram OAuth down your throat for simple requests. An API key is perfectly good enough in most cases.

All that said, I may hook the plugin into mem_form as well for completeness, haven’t decided.

Re: Calling all MailChimp users

Hi Stef,

MailChimp has reared is cartoon head in connection with one of my exisiting client websites.

I have some existing online contact forms which collect a tick/no-tick from the users about their mailing list preference. The contact form emails, sent to the client, are effectively manually trawled to pull out the opted-in email addresses.

Would your plugin enable me to turn that exisiting checkbox into a secret “subscribe” directive to MailChimp? And then expect MailChimp to do the “welcome-did-you-really-subscribe” handshake email with the user.

Re: Calling all MailChimp users

Would your plugin enable me to turn that exisiting checkbox into a secret “subscribe” directive to MailChimp? And then expect MailChimp to do the “welcome-did-you-really-subscribe” handshake email with the user.

Yep. Just make a zem_contact form as usual and set it to subscribe to your existing list. Through judicial use of the callback signals (return codes sent from the MailChimp module back to ZCR) you can either get it to continue mailing out as normal, or — as is the default with the module — just fire the data at MailChimp and quit. As long as your MailChimp is set to deliver welcome messages on successful subscription, it’s game on.

I’ll send you the plugin. Shout if you need anything doing to it, or feel free to hack away and improve it!