oneup/mailchimp-api-v3

Simple PHP library for MailChimp API V3

2.3.1 2018-06-18 13:20 UTC

This package is auto-updated.

Last update: 2020-06-29 04:38:27 UTC


README

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');