2017 © Pedro Peláez
 

library mailchimp

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

image

hugofirth/mailchimp

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

  • Monday, June 15, 2015
  • by hugofirth
  • Repository
  • 8 Watchers
  • 108 Stars
  • 89,838 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 33 Forks
  • 17 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Mailchimp API w. support for Laravel

The package supports use with the Laravel framework (v4) providing a MailchimpWrapper facade., (*1)


Setup:

In order to install add the following to your composer.json file within the require block:, (*2)

"require": {
    …
    "hugofirth/mailchimp": "2.0.*",
    …
}

Within Laravel, locate the file ..app/config/app.php *., (*3)

Add the following to the providers array:, (*4)

'providers' => array(
    …
    'Hugofirth\Mailchimp\MailchimpServiceProvider',
    …
),

Furthermore, add the following the the aliases array:, (*5)

'aliases' => array(
    …
    'MailchimpWrapper'       => 'Hugofirth\Mailchimp\Facades\MailchimpWrapper',
    …
),

Publish the configuration, (*6)

$ php artisan config:publish hugofirth/mailchimp

Lastly, run the command composer update., (*7)

* The subsequent steps should be repeated for any file app.php created for additional environments., (*8)


Usage:

Your unique MailChimp API key should be set in the package's config found in app/config/packages/hugofirth/mailchimp/config.php, (*9)

Methods of the MailChimp api class work as described by the MailChimp API docs found Here. Examples of actual usage can be found [Here][4] (Warning: Examples use CakePHP). Thanks to Laravel's use of the "Facade" design pattern, all methods may be called in the following manner:, (*10)

…
//Retrieve an array of lists for your account
$lists = MailchimpWrapper::lists()->getList()['data'];
…
//Subscribe a user, with email: $email_address, to a list with id: $list_id
MailchimpWrapper::lists()->subscribe($list_id, array('email'=>$email_address));

In order to allow for auto-completion, you can include a use statement for the Facade:, (*11)

<?php

use Hugofirth\Mailchimp\Facades\MailchimpWrapper;

class SomeClass
{
    public function someMethod()
    {
        MailchimpWrapper:: //You should be able to get auto completion here for the API methods/properties
    }
}

Enjoy!, (*12)

The Versions

15/06 2015

dev-master

9999999-dev

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

  Sources   Download

MIT

The Requires

 

by Hugo Firth

laravel mailchimp

26/11 2013

v2.0.3

2.0.3.0

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

  Sources   Download

MIT

The Requires

 

by Hugo Firth

laravel mailchimp

19/09 2013

v2.0.2

2.0.2.0

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

  Sources   Download

The Requires

 

by Hugo Firth

laravel mailchimp

19/09 2013

v2.0.1

2.0.1.0

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

  Sources   Download

The Requires

 

by Hugo Firth

laravel mailchimp

19/09 2013

v2.0.0

2.0.0.0

Wrapper on the Mailchimp class provided by Mailchimp - with support for Laravel 4. v2.0.0 supports Mailchimp API verion 2.0

  Sources   Download

The Requires

 

by Hugo Firth

laravel mailchimp

30/08 2013

v1.0.0

1.0.0.0

Wrapper on the MCAPI class provided by Mailchimp - with support for Laravel 4

  Sources   Download

The Requires

 

by Hugo Firth

laravel mailchimp