oneup / mailchimp-api-v3
Simple PHP library for MailChimp API V3
Installs: 20 994
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 3
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.9
- phpunit/phpunit: ^9.5
README
This is a basic PHP wrapper for the MailChimp API V3 for subscribe/unsubscribe to/from lists.
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');