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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners