Thursday, July 30, 2009

Mailchimp

We are in the process of Re-Architecting a CMS/Publishing solution based on php/mysql. One of the features we are going to rewrite is its 'Newsletter' function. The problem with the existing solution is the scalability. When the number of subscribers grow large the 'Newsletter' function breaks down.

Alternatively to the option of improving the already written 'Newsletter' function we looked in to using a 3rd party service and came across 'MailChimp'. Mailchimp is a fully fledged email campaign management tool. Beside the core functionality of sending an email to a list of users at a designated time, MailChimp provides many other features such as;
1. Easy to use API and Off the shelf integrations to popular CMS systems - API is critical for our requirement
2. Rich Tracking, Reporting and Analysis Tools (Eg: Google Analytic integration)
3. Powerful subscription management features
4. Shopping cart integration
5. Ability to test your email in lot of different email clients before actually sending it - Inbox Inspector
6. Flexible Pricing Scheme
7. Support for different types of Emails (HTML, Text ) and also tools to design them
8. Higher guarantee for deliverability by implementing various Authentication schemes to pass ISP filterings

Boosted by the above product features, we were interested in finding out how the API would look like. Recently they have provided wrappers around the former API making it more easier to work with. There were PHP and .Net wrappers plus few more APIs done by 3rd parties. We wanted to check out PHP API/Wrapper.

There were only 2 classes to be learnt.
1. conf.inc.php - Contains all configuration information and is initiated automatically when included in your programme.
2. MCAPI.class.php - The main API wrapper class.

In addition there were many very simple easy to understand examples. For all we wanted to achieve with MailChimp there was an example. The usual house keeping work before and after each API method was not needed at all since the API wrapper is so neatly written.

Eg: When sending a campaign mail you juse have to do;
$campaign = new MCAPI($apikey);
$campaign->campaignSendNow($campaignId);
That's it! The configuration info like $apikey is stored in conf.inc.php file along with your MailChimp account information and you don't have to login or perform any other initial calls. Also the API is flexible enough to return info as php arrays, JSON or even XML.
Post a Comment