
Introduction:
Create MailChimp Account Setting:
Setup .env configuration:
Add your MailChimp API Key and LIst ID in .env file
Install Package for MailChimp Newsletter:
We will install spatie/laravel-newsletter package for use MailChimp API methods. So first you can run below command in your cmd.
After install MailChimp Newsletter package we need to add below provider path and alias path in config/app.php.
We need to create laravel-newsletter.php for setup MailChimp Newsletter variables.
To publish the config file to app/config/laravel-newsletter.php run in your cmd:
This will publish a file laravel-newsletter.php in your config directory with the following contents and set your mailchimp apikey .env variable and list :
Usage:
After installing the package and fill in the values in the config-file working with this package.
Subscribing, unsubscribing and delete subscriber
You can also pass some merge variables as the second argument, third argument as list name and you can also subscribe update someone:
Hope this helps you well, feel free to add your comments/feedbacks and need more assistance regarding laravel service or Hire Laravel Developer, be in touch