dlds / yii2-mailchimp
MailChimp integration for YeahCoach project
Installs: 1 418
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- drewm/mailchimp-api: ~2.5
- yiisoft/yii2: ~2.0.13
Requires (Dev)
- codeception/codeception: 2.4.0
- codeception/specify: 1.0
- codeception/verify: 1.0.0
- phpmd/phpmd: 2.6.0
- squizlabs/php_codesniffer: 3.2.3
This package is not auto-updated.
Last update: 2025-02-16 07:12:50 UTC
README
MailChimp API (v3) integration developed for YeahCoach project.
Installation
Extension installaton
Use composer
to install the extension to your Yii2 installation.
Component Setup
The extension works as a standard Yii2 component.
To use it, just add and configure it inside the main.php
configuration array
(or wherever suitable for your setup), e.g.
'components' => [ // ... 'mailChimp' => [ 'class' => 'dlds\mailchimp\YcMailChimp', 'apiKey' => 'a576b8adf6d34916d2f7eedf0eb4dd2f-us17', 'listId' => '123abc4560', 'categoryId' => 'def890abcd' ] ]
Required initial values are only class
and apiKey
, but it's recommended to specify all properties as shown
to avoid the need to pass them later (you can always override the default values and pass them as method parameters).
Usage example
Example usage:
// load the component $chimp = Yii::$app->mailChimp; // get unsubscribed users on your MailChimp list $resultObject = $chimp->getUnsubscribedContacts(); // print returned array of MailChimpBasicUser objects print_r($resultObject->getData());
Testing
Codeception unit tests are included. From the root directory:
php ./vendor/bin/codecept run unit
Built with
- MailChimp API - simple MailChimp API wrapper (uses cURL for API calls)