Easily integrate MailChimp in Laravel 5
Today we released a new major version of our laravel-newsletter package. This package makes it easy to integrate MailChimp in your Laravel app. Under the hood V3 of the MailChimp API is used. If you're used the older version of our package be sure to upgrade by the end of this year: MailChimp will shut down V2 of their API.
Here are a few examples what you can do with it:
Newsletter::subscribe('rincewind@discworld.com');
Newsletter::unsubscribe('the.luggage@discworld.com');
//Merge variables can be passed as the second argument
Newsletter::subscribe('sam.vines@discworld.com', ['firstName'=>'Sam', 'lastName'=>'Vines']);
//Subscribe someone to a specific list by using the third argument:
Newsletter::subscribe('nanny.ogg@discworld.com', ['firstName'=>'Nanny', 'lastName'=>'Ogg'], 'Name of your list');
//Get some member info, returns an array described in <a href="http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members">the official docs</a>
Newsletter::getMember('lord.vetinari@discworld.com');
//Returns a boolean
Newsletter::hasMember('greebo@discworld.com');
//If you want to do something else, you can get an instance of the underlying API:
Newsletter::getApi();
There are a few additional methods available. If you need to handle multiple lists, the package can handle that for you as well. Head over to the documentation of the package on GitHub to learn all the options. If you like it, be sure to check out our other packages.
One can store a submitted email "subscribe me" form in a database with Laravel - and then keep lists, use Mail::facade to send emails with Mailgun or other service, show a compose and send interface to admin users logged in to the Laravel website... I wonder, why you use Mailchimp for mailing list subscription when one could use an AWS or Mailgun or other service within your own website and database list?