library pg-mailchimp
ZF2 module for MailChimp 2.0 API
earlhickey/pg-mailchimp
ZF2 module for MailChimp 2.0 API
- Monday, July 21, 2014
- by earlhickey
- Repository
- 1 Watchers
- 1 Stars
- 1,494 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 2 Forks
- 1 Open issues
- 3 Versions
- 0 % Grown
PgMailchimp
ZF2 MailChimp Module, (*1)
Installation
Main Setup
By cloning project
- Install the PgMailchimp ZF2 module
by cloning it into
./vendor/.
- Clone this project into your
./vendor/ directory.
With composer
-
Add this project in your composer.json:, (*2)
"require": {
"earlhickey/pg-mailchimp": "1.*"
}
-
Now tell composer to download PgMailchimp by running the command:, (*3)
$ php composer.phar update
Post installation
-
Enabling it in your application.config.php file., (*4)
<?php
return array(
'modules' => array(
// ...
'PgMailchimp',
),
// ...
);
-
Copy ./vendor/earlhickey/PgMailchimp/config/pg-mailchimp.global.php.dist to ./config/autoload/pg-mailchimp.global.php and change the values as desired., (*5)
Usage
-
Subscribe, (*6)
// create recipient
$recipient = new \stdClass();
$recipient->firstname = 'John';
$recipient->lastname = 'Doe';
$recipient->gender = '';
$recipient->dateOfBirth = '';
$recipient->email = 'johndoe@domain.com';
$subscribe = $this->mailchimp()->subscribe($recipient);
-
Unsubscribe, (*7)
// create recipient
$recipient = new \stdClass();
$recipient->email = 'johndoe@domain.com';
$unsubscribe = $this->mailchimp()->unsubscribe($recipient);