首页 > 解决方案 > Does Mailchimp have a send API is Automation the way to go?

问题描述

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?

标签: laravelmailchimp-api-v3.0

解决方案


欢迎!

如果我猜对了,你想使用 MailChimp 从 Laravel 发送邮件/通知吗?

使用这个 composer package可以很容易地做到这一点,但它不受 Laravel 的约束。

只需在您的 CLI 中运行:

composer require drewm/mailchimp-api

然后你可以像这样调用 MailChimp API v3:

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',
            ]);

如果您想要更多 Newsletter 功能,可以使用spatie/laravel-newsletter 包:

composer require spatie/laravel-newsletter

然后按照文档进行操作。

希望这可以帮助!


推荐阅读