2017 © Pedro Peláez
 

yii2-extension yii2-mailchimp

MailChimp integration for YeahCoach project

image

dlds/yii2-mailchimp

MailChimp integration for YeahCoach project

  • Friday, May 25, 2018
  • by dlds
  • Repository
  • 1 Watchers
  • 0 Stars
  • 75 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1150 % Grown

The README.md

Yii2 MailChimp extension for YeahCoach project

MailChimp API (v3) integration developed for YeahCoach project., (*1)

Installation

Extension installaton

Use composer to install the extension to your Yii2 installation., (*2)

Component Setup

The extension works as a standard Yii2 component., (*3)

To use it, just add and configure it inside the main.php configuration array (or wherever suitable for your setup), e.g., (*4)

    '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)., (*5)

Usage example

Example usage:, (*6)

// 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:, (*7)

php ./vendor/bin/codecept run unit

Built with

  • MailChimp API - simple MailChimp API wrapper (uses cURL for API calls)

The Versions

25/05 2018