2017 © Pedro Peláez
 

library mailchimp-laravel

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

image

skovmand/mailchimp-laravel

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  • Sunday, February 11, 2018
  • by skovmand
  • Repository
  • 7 Watchers
  • 112 Stars
  • 266,627 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 25 Forks
  • 2 Open issues
  • 11 Versions
  • 7 % Grown

The README.md

This package is abandoned.

The Mailchimp API v2.0 was deprecated from jan 1st 2017. This package uses the v2 API, because it relies on the Mailchimp PHP API Client, which uses the v2 API., (*1)

This package will not recieve updates for future Laravel versions., (*2)

Please use an api v3-compatible package instead, several are available on Packagist, (*3)

skovmand/mailchimp-laravel

A minimal service provider to set up and use the Mailchimp API v2 PHP library in Laravel v5.*, (*4)

For Laravel v4 check https://packagist.org/packages/hugofirth/mailchimp, (*5)

How it works

This package contains a service provider, which binds an instance of an initialized Mailchimp client to the IoC-container., (*6)

You recieve the Mailchimp client through depencency injection already set up with your own API key., (*7)

Usage example, (*8)

class NewsletterManager
{
    protected $mailchimp;
    protected $listId = '1234567890';        // Id of newsletter list

    /**
     * Pull the Mailchimp-instance from the IoC-container.
     */
    public function __construct(\Mailchimp $mailchimp)
    {
        $this->mailchimp = $mailchimp;
    }

    /**
     * Access the mailchimp lists API
     */
    public function addEmailToList($email)
    {
        try {
            $this->mailchimp
              ->lists
              ->subscribe(
                $this->listId,
                ['email' => $email]
              );
        } catch (\Mailchimp_List_AlreadySubscribed $e) {
            // do something
        } catch (\Mailchimp_Error $e) {
            // do something
        }
    }
}

Or you can manually instantiate the Mailchimp client by using:, (*9)

$mailchimp = app('Mailchimp');, (*10)

Setup

Step 1: Adding the dependency to composer.json, (*11)

Add this to your composer.json in your Laravel folder. Note: Adding this dependency will automatically setup "mailchimp/mailchimp": "~2.0" too., (*12)

"require": {
    "skovmand/mailchimp-laravel": "1.*",
}

Step 2: Register the service provider, (*13)

Register the service provider in config/app.php by inserting into the providers array, (*14)

'providers' => [
  Skovmand\Mailchimp\MailchimpServiceProvider::class,
]

Step 3: From the command-line run, (*15)

php artisan vendor:publish --provider="Skovmand\Mailchimp\MailchimpServiceProvider"

This will publish config/mailchimp.php to your config folder., (*16)

Step 4: Edit your .env file, (*17)

MAILCHIMP_API_KEY="your-api-key-here"

Good to go!, (*18)

The Versions

11/02 2018

dev-master

9999999-dev

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  Sources   Download

MIT

The Requires

 

11/02 2018

1.0.9

1.0.9.0

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  Sources   Download

MIT

The Requires

 

31/08 2017

1.0.8

1.0.8.0

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  Sources   Download

MIT

The Requires

 

22/02 2017

1.0.7

1.0.7.0

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  Sources   Download

MIT

The Requires

 

25/08 2016

1.0.6

1.0.6.0

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  Sources   Download

MIT

The Requires

 

01/04 2016

1.0.5

1.0.5.0

A minimal service provider to set up and use the Mailchimp Api v2 PHP library in Laravel 5.*

  Sources   Download

MIT

The Requires

 

23/12 2015

1.0.4

1.0.4.0

A minimal service provider to set up and use the Mailchimp PHP library in Laravel 5

  Sources   Download

MIT

The Requires

 

16/05 2015

1.0.3

1.0.3.0

A minimal service provider to set up and use the Mailchimp PHP library in Laravel 5

  Sources   Download

MIT

The Requires

 

18/02 2015

1.0.2

1.0.2.0

A minimal service provider to set up and use the Mailchimp PHP library in Laravel 5

  Sources   Download

MIT

The Requires

 

17/02 2015

1.0.1

1.0.1.0

A minimal service provider to set up and use the Mailchimp PHP library in Laravel 5

  Sources   Download

MIT

The Requires

 

17/02 2015

1.0

1.0.0.0

A minimal service provider to set up and use the Mailchimp PHP library in Laravel 5

  Sources   Download

MIT

The Requires