/mailchimp-api

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

Primary LanguagePHPMIT LicenseMIT

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 curl and a pulse. Abstraction is for chimps.

Examples

List lists (lists/list method)

<?php
$MailChimp = new MailChimp('abc123abc123abc123abc123abc123-us1');
print_r($MailChimp->call('lists/list'));

Subscribe someone to a list

<?php
$MailChimp = new MailChimp('abc123abc123abc123abc123abc123-us1');
$result = $MailChimp->call('lists/subscribe', array(
				'id'                => 'b1234346',
				'email'             => array('email'=>'davy@example.com'),
				'merge_vars'        => array('FNAME'=>'Davy', 'LNAME'=>'Jones'),
				'double_optin'      => false,
				'update_existing'   => true,
				'replace_interests' => false,
				'send_welcome'      => false,
			));
print_r($result);

Note for contributors: This is not Code Golf.