earlhickey / pg-mailchimp
ZF2 module for MailChimp 2.0 API
Installs: 1 505
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: >=5.3.3
- zendframework/zendframework: 2.3.*
- zf-commons/zfc-base: 0.*
This package is not auto-updated.
Last update: 2024-12-21 17:22:30 UTC
README
ZF2 MailChimp Module
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:
"require": { "earlhickey/pg-mailchimp": "1.*" }
-
Now tell composer to download PgMailchimp by running the command:
$ php composer.phar update
Post installation
-
Enabling it in your
application.config.php
file.<?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.
Usage
-
Subscribe
// 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
// create recipient $recipient = new \stdClass(); $recipient->email = 'johndoe@domain.com'; $unsubscribe = $this->mailchimp()->unsubscribe($recipient);