Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Super-simple, minimum abstraction MailChimp API v2 wrapper, in PHP

branch: master

Merge pull request #22 from railto/master

Minor update to
latest commit 4596a56b4a
Drew McLellan authored
Octocat-spinner-32 src PSR-1 and PSR-2 conformance March 01, 2014
Octocat-spinner-32 LICENSE Initial commit July 30, 2013
Octocat-spinner-32 Minor update to April 14, 2014
Octocat-spinner-32 composer.json Tidying and crediting December 18, 2013

MailChimp API

Super-simple, minimum abstraction MailChimp API v2 wrapper, in PHP.

I hate complex wrappers. This lets you get from the MailChimp API docs to the code as directly as possible.

Requires PHP 5.3 and a pulse. Abstraction is for chimps.


You can install the mailchimp-api using Composer. Just add the following to your composer.json:

    "require": {
        "drewm/mailchimp-api": "dev-master"

You will then need to:

  • run composer install to get these dependencies added to your vendor directory
  • add the autoloader to your application with this line: require("vendor/autoload.php")

Alternatively you can just download the MailChimp.php file and include it manually.


List lists (lists/list method)

$MailChimp = new \Drewm\MailChimp('abc123abc123abc123abc123abc123-us1');

Subscribe someone to a list

$MailChimp = new \Drewm\MailChimp('abc123abc123abc123abc123abc123-us1');
$result = $MailChimp->call('lists/subscribe', array(
                'id'                => 'b1234346',
                'email'             => array('email'=>''),
                'merge_vars'        => array('FNAME'=>'Davy', 'LNAME'=>'Jones'),
                'double_optin'      => false,
                'update_existing'   => true,
                'replace_interests' => false,
                'send_welcome'      => false,

Note for contributors: This is not Code Golf.

Something went wrong with that request. Please try again.