Gathering e-mail addresses and using them with a third-party e-mail service
E-mail lists and newsletters are still a popular and efficient way to communicate with large groups of people. In this recipe, we'll use Laravel and the free MailChimp service to set up an easy way to gather e-mail subscriptions.
Getting ready
For this recipe, we'll need a working Laravel 4 installation, as well as a free account with http://mailchimp.com/ and generated API keys in Mailchimp's account section. We'll also need to create at least one list in Mailchimp.
How to do it...
To complete this recipe, follow these steps:
In the
app
directory, create a new directory namedlibraries
.Download Mailchimp's API library from http://apidocs.mailchimp.com/api/downloads/#php, then unzip it and place the file
MCAPI.class.php
in the newlibraries
folder.Open Laravel's
composer.json
file and add the libraries directory to theautoload
section. That section should resemble the following snippet:"autoload": { "classmap": ...