Laravel 6 , Laravel , Laravel 7 , Laravel 8
In this blog,I will learn you how to send mail using mailchimp in laravel 8. we will show example of laravel 8 send mail using mailchimp.do you want to integrate the mailchimp newsletter functionality to your laravel 8application? mailchimp is an email marketing service that allows us to send newsletters to our subscribers. in this article, i show you how to integrate the mailchimp newsletter into the laravel 8 website.
MailChimp is one of the popular email marketing services, which manages the subscribers of your website. Using MailChimp, your subscribers will get a newsletter about new content, announcements, deals, and much more depending on your choice. This is a kind of automated system. The website owner does not need to remember sending the newsletter to subscribers. MailChimp handles on its own, which saves us a lot of time.
Step 1: Get MailChimp API Key and Audience ID
In this setp,In order to integrate the MailChimp API, you need to get an API key and Audience ID.
Follow the steps below to get these credentials.Login to your MailChimp account. Under the user drop-down, select the Account.
Click on Extras->API keys.
Under the Your API keys section, click on Create A Key and copy your API key which we need in a moment.
Now you have your API key ready. Next, get an Audience ID to which you need to add your subscribers. For this, click on the Audience menu and then select the option Settings from the Manage Audience drop-down.
Under the Settings click on the ‘Audience name and defaults’.
On the next page, you will find your Audience ID.
Step 2:Installation Library
Mailchimp has built the fantastic library Laravel newsletter. I am going to integrate the MailChimp newsletter using this library
Open the terminal in your project’s root directory and run the command:
composer require mailchimp/mailchimp
Make sure to replace placeholder ROUTE_HERE with the actual value.
Route::get('/send-mail-using-mailchimp', [MailChimpController::class, 'index'])->name('send.mail.using.mailchimp.index');
Next, in your controller file, add the facade of the installed package.
class MailChimpController extends Controller
public function index(Request $request)
$listId = env('MAILCHIMP_LIST_ID');
$mailchimp = new \Mailchimp(env('MAILCHIMP_KEY'));
$campaign = $mailchimp->campaigns->create('regular', [
'list_id' => $listId,
'subject' => 'Example Mail',
'from_email' => '[email protected]',
'from_name' => 'Rajesh',
'to_name' => 'Rajesh Subscribers'
'html' => $request->input('content'),
'text' => strip_tags($request->input('content'))
dd('Campaign send successfully.');
It will help you...