07.26.2013 Technical Innovation

Don't fear the monkey! Introducing a friendlier MailChimp module.

A couple months ago one of my coworkers asked me how to change some text on a block generated by our MailChimp module. I had to tell him the bad news: that text was hard-coded and he’d have to work pretty hard to change it. He also wanted to change the text on the Submit button… which wasn’t much easier.

Now, the MailChimp module is pretty mature, with over 9000 installs just on the 7.x branch… but we have run into a couple consistent complaints in the issue queue:

The first of those is a big problem. As we had grown the feature set of the module, the logic tree for when and how to subscribe or unsubscribe users based on user preference, list configuration, role assignments, cron options, and the phase of the moon had become quite tangled. In an attempt to permanently resolve these issues, which kept shifting every time we released a patch, we attacked from two angles:

  1. We refactored the entire logic tree, separating out the “what to do” logic from the “how to do it” logic. To make this cleaner, we expanded the collection of functions that could be delegated to cron to cover everything, where previously only certain Subscribe & Unsubscribe functions could be run.
  2. We wrote automated tests using Simpletest.

We are big believers in automated testing at ThinkShout, and given how many little subscription logic issues we had encountered with MailChimp, this seemed like the perfect place to leverage the power of automated tests. Since the Mailchimp module integrates with the Mailchimp service using an API, the first thing we had to do was create a dummy API to bounce our logic off of. Once that was in place, we wrote a bunch of automated tests and ran them against both the latest stable release (7.x-2.10) and our development releases. Then we had to figure out if all the failed tests were poorly written or actually indicated issues in our code. Needless to say, it was a little bit of both, and we now have a lot more confidence in our subscription logic handling.

If you’re thinking about automated testing for any project, I highly recommend it.

But let’s get back to those problems we were trying to address before. The other one is a little more exciting for all you site builders and administrators: configuration options!

We dove pretty deep here, too. The list settings have been completely restructured for clarity and usability, and the best way to understand what this means is probably to install the module, so I’ll just run through some of the highlights of MailChimp 7.x-2.12:

So what are you waiting for? Go download the new version! It won’t bite.

Get In Touch

Questions? Comments? We want to know! Drop us a line and let’s start talking.

Learn More
Get In Touch

Related Blog Posts