altelma/laravel-mailchimp

A packages provide you to connect with mailchimp API v3, so easiest.

2.0 2022-03-11 12:22 UTC

This package is auto-updated.

Last update: 2024-10-11 18:09:55 UTC


README

JWT

Laravel MailChimp

Total Downloads

A packages provides you to connect mailchimp API v3

Setup

  • Run $ composer require altelma/laravel-mailchimp

  • (Only for Laravel 5.5 or minor) Add provider to config/app.php

providers => [
        Altelma\LaravelMailChimp\MailChimpServiceProvider::class  
],

Make sure you never use "MailChimp" or exists this in your project. After you finish config all run artisan to create config

php artisan vendor:publish

For optional if you want to use Alias class you can add this to config/app.php

aliases => [
      'MailChimp' => ALtelma\LaravelMailChimp\MailChimpFacade::class
]

Lumen

  • Add provider to bootstrap/app.php
$app->register(Altelma\LaravelMailChimp\MailChimpServiceProvider::class);

  • Copy vendor/altelma/laravel-mailchimp/config/mailchimp.php to config/mailchimp.php

  • Add config to bootstrap/app.php

$app->configure('mailchimp');
  • Allow call package via Facade, uncomment
$app->withFacades();

if (!class_exists('MailChimp')) {
    class_alias('Altelma\LaravelMailChimp\LaravelMailChimp', 'MailChimp');
}

Usage

$mc = new MailChimp('Your API KEY');
$results = $mc->get('lists/your_directory_list/members');
echo json_decode($results);

// or
return reponse()-json($results);

// With Alias
$results = MailChimp::get('lists/your_directory_list/members');
echo json_decode($results);

// or
return reponse()-json($results);

Bug report

This package is not perfect right, but it can improve together. If you've found bug or have any suggestions. Send that to me or create a new issue. Thank you to use it.