coderbyheart / mailchimp-bundle
Thin abstraction layer for the MailChimp API 2.0.
Installs: 4 539
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.0
- doctrine/annotations: ~1.2.1
- kriswallsmith/buzz: >=0.11
Requires (Dev)
- codeclimate/php-test-reporter: ~0.1
- phpunit/phpunit: ~4.3
This package is not auto-updated.
Last update: 2020-01-20 03:30:10 UTC
README
Thin abstraction layer for the MailChimp API 2.0.
All API endpoints are implemented … by not implementing them but taking advantage of the API's naming conventions.
Getting started
Install with composer:
php composer.phar require coderbyheart/mailchimp-bundle
Enable the Bundle:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Coderbyheart\MailChimpBundle\CoderbyheartMailChimpBundle(),
);
}
Configure the Bundle:
// app/config/config.yml
coderbyheart_mail_chimp:
api_key: 123-us1 # the api key provided by mailchimp
return_type: object # return response data as 'object' or 'array'
Usage
$mailchimp = $container->get('mailchimp');
$lists = $mailchimp->listsList();
Documentation
The api endpoints are reached via a method call on the MailChimp API object instance. The method name is composed by concatenating the endpoint url. Parameters are provided via a hash as the methods argument.
API endpoint | Method | Arguments |
---|---|---|
lists/list |
listsList |
|
lists/batch-unsubscribe |
listsBatch_unsubscribe |
array('batch' => $batch) |