https://res.cloudinary.com/practicaldev/image/fetch/s--iGXO6G-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lq0l7je3o34l3wnetco.gif In this post, I will show you how to add user to the subscription list of Mailchimp.

* * @param array $data * @return \App\Models\User */ protected function create(array $data) { return User::create([ 'firstname' => $data['firstname'], 'lastname' => $data['lastname'], 'email' => $data['email'], 'password' => Hash::make($data['password']), 'address' => $data['address'], 'phone' => $data['phone']]); }}

First services.php 'mailchimp' => [ 'key' => env('MAILCHIMP_KEY'), ], And in.env file set the api key and audience id

md5(strtolower($userEmail)), ['merge_fields' => ['FNAME' => $firstname, 'LNAME' => $lastname,'ADDRESS'=> $address, 'PHONE'=> $phone]); Create an automated email with Mailchimp
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners