I'm currently organising the third edition Full Stack Europe. It's a conference in Antwerp, Belgium in October for developers who want to learn across the stack. We have a great line up with lots of familiar faces! Register your ticket now!

Easily integrate MailChimp in Laravel 5

Original – by Freek Van der Herten – 2 minute read

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:



//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>

//Returns a boolean

//If you want to do something else, you can get an instance of the underlying API:

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.

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.


What are your thoughts on "Easily integrate MailChimp in Laravel 5"?

Comments powered by Laravel Comments
Want to join the conversation? Log in or create an account to post a comment.