A
A
Andr Lw12016-01-05 15:47:32
API
Andr Lw1, 2016-01-05 15:47:32

How to send emails via Mailchimp API on Laravel 4?

everything is clear with Mailgun:

Mail::send('emails.example', $data, function($message) use ($user)
    {
      $message->from('[email protected]', 'CompanyName');
            $message->to($user->email)->subject('10 популярных записей на этой неделе');    
    });

But how to do the same only through the Mailchimp service?
I found this package: https://github.com/hugofirth/laravel-mailchimp
but it states that you can add subscribers to MailList on Mailchimp.
for example, how to submit a list of popular posts on your site?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
seriogja, 2016-01-05
@seriogja

You have your own user base on the site. Your Mailchimp account has various mailing lists: news, promotions, etc. You need to synchronize these databases via the API: the user has signed up - follow

MailchimpWrapper::lists()->subscribe($list_id, array('email'=>$email_address));
, unsubscribed - unsubscribe. Thus, you keep the database up-to-date on your service account. Also, through the API (or manually through the Mailchimp website), you send to the mailing list.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question