1

For MailChimp API 2.0 there was a method 'batch-subscribe', to send in an array of email addresses to be added to a specific list in MailChimp.
How to implement this in the new Rest Architecture based MailChimp API 3.0?
See https://github.com/mailchimp/APIv3-examples/wiki/Overview
It says it would work with array of objects
But by the schema it only accepts an object
Schema https://us9.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json

4

4 回答 4

9

MailChimp API v3.0 现已上线!他们还添加了更好的批处理操作功能,让您只需一次调用即可进行多项操作。您可以在MailChimp apiV3的这个 php 包装器的帮助下使用下面的代码进行批处理操作。

    $data1 =array(
            'email_address' => 'testingmail1@gmail.com',
            'status' => 'subscribed',
            'merge_fields' => array('FNAME' => 'Testing', 'LNAME' => 'Mail1'));
    $data2 =
        array(
            'email_address' => 'testingmail2@example.com',
            'status' => 'subscribed',
            'merge_fields' => array('FNAME' => 'Testing', 'LNAME' => 'Mail2'));
    $attributes = array(
        'operations' => array(
            array(
                'path' => 'lists/' . $listID . '/members',
                'method' => 'POST',
                'body' => json_encode($data1)
            ),
            array(
                'path' => 'lists/' . $listID . '/members',
                'method' => 'POST',
                'body' => json_encode($data2)
            ),
        ));

    $response = $MailChimp->post('batches/', $attributes);
于 2016-01-12T09:52:13.670 回答
1

您链接的页面看起来像来自 beta 版的文档,但无论哪种方式,他们都说尚未实现批处理操作。FWIW,真正的文档也将批处理操作列为路线图的一部分,所以我怀疑他们还没有完成。

于 2015-08-31T16:04:00.867 回答
1

这在 Mailchimp 端不是问题。您只需要正确使用数组和对象。

好的批量订阅示例,您可以在这里找到https://rudrastyh.com/wordpress/wp-users-to-mailchimp-list.html#batch_subscribe_php

于 2016-06-14T01:48:07.383 回答
0

是的。这是 Mailchimp 端的一个问题。我们报告了它,他们在一天左右的时间里把它修好了。

于 2016-04-20T12:00:33.480 回答