1up-lab / mailchimp-api-v3

MailChimp API V3 Wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MailChimp API V3 Wrapper

This is a basic PHP wrapper for the MailChimp API V3 for subscribe/unsubscribe to/from lists.

Author Software License Total Downloads

Examples

Subscribe

$mc = new \Oneup\MailChimp\Client('thisShouldBeYourApiKeyFromMailChimp-us1');
$response = $mc->subscribeToList(
    'ea06b81001',           // List ID
    'foo@bar.baz',          // E-Mail address 
    [                       // Array with first/lastname (MailChimp merge tags) 
        'FNAME' =>  'Foo',
        'LNAME' => 'Bar',
    ],
    true                    // Double opt-in true
);

Unsubscribe

$mc = new \Oneup\MailChimp\Client('thisShouldBeYourApiKeyFromMailChimp-us1');
$response = $mc->unsubscribeFromList('yourListId', 'foo@bar.baz');

About

MailChimp API V3 Wrapper

License:MIT License


Languages

Language:PHP 100.0%