dlds/yii2-mailchimp

YeahCoach项目的MailChimp集成

安装次数: 1,411

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

0.1.3 2018-05-25 12:06 UTC

This package is not auto-updated.

Last update: 2024-09-15 05:05:21 UTC


README

为YeahCoach项目开发的MailChimp API (v3) 集成。

安装

扩展安装

使用 composer 将扩展安装到您的Yii2安装中。

组件设置

该扩展作为标准的Yii2组件运行。

要使用它,只需将其添加并配置在 main.php 配置数组中(或适合您设置的任何位置),例如:

    'components' => [    
        
        // ...
        
        'mailChimp' => [
            'class' => 'dlds\mailchimp\YcMailChimp',
            'apiKey' => 'a576b8adf6d34916d2f7eedf0eb4dd2f-us17',
            'listId' => '123abc4560',
            'categoryId' => 'def890abcd'
        ]
    ]

必需的初始值仅为 classapiKey,但建议指定所有属性,以免以后需要传递(您始终可以覆盖默认值并将它们作为方法参数传递)。

使用示例

示例使用

// load the component
$chimp = Yii::$app->mailChimp;

// get unsubscribed users on your MailChimp list
$resultObject = $chimp->getUnsubscribedContacts();

// print returned array of MailChimpBasicUser objects
print_r($resultObject->getData());

测试

包括Codeception单元测试。从根目录

php ./vendor/bin/codecept run unit

构建于

  • MailChimp API - 简单的MailChimp API包装器(使用cURL进行API调用)