2

I was about to start developing my companies website which is currently in research phase. I was researching with the MailChimp API (https://developer.mailchimp.com/documentation/mailchimp/reference/overview/) but did not find the API for using a send mail function by manager told me that it was present in our previous version of the company's website.

I came across Automation in MailChimp (https://developer.mailchimp.com/documentation/mailchimp/reference/automations/#%20) can this be used to make a send email request, but I don't see the option for setting email send time in the api.

Can any one help?

1 Answers1

0

welcome!

If i get you right, you want to send mails / notifications from Laravel using MailChimp?

This can be done quite easily using this composer package, but it's not bound to Laravel.

Just run in your CLI:

composer require drewm/mailchimp-api

And then you can do calls to MailChimp API v3 like this:

use \DrewM\MailChimp\MailChimp;

$MailChimp = new MailChimp('abc123abc123abc123abc123abc123-us1');
$result = $MailChimp->get('lists');
$list_id = 'b1234346';

$result = $MailChimp->post("lists/$list_id/members", [
                'email_address' => 'davy@example.com',
                'status'        => 'subscribed',
            ]);

If you want some more Newsletter functionalities you can use the spatie/laravel-newsletter package:

composer require spatie/laravel-newsletter

and then follow the documentation.

Hope this helps!

Stefan
  • 2,028
  • 2
  • 36
  • 53
  • Just one question this doesn't seem to be officially supported package is it worth using in a production website other than that it is a perfect solution – Muhammad Sharif Aug 17 '19 at 10:49