matperez/yii2unisender
最新稳定版本:1.1.2
Composer 安装命令:
composer require matperez/yii2unisender
包简介
yii2 unisender extension
关键字:
README 文档
README
yii2 unisender extension
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist matperez/yii2unisender "~1.0"
or add
"matperez/yii2unisender": "~1.0"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
'components' => [ 'unisender' => [ 'class' => \matperez\yii2unisender\UniSender::class, 'apiConfig' => [ 'apiKey' => '...' ], ]
You can also use it with the dependency container:
Yii::$container->setSingleton(\matperez\yii2unisender\UniSenderInterface::class, function() { return Yii::$app->unisender; });
For now it's supports the following operations:
Get a user fields array:
$fields = $unisender->getFields()->getResult;
Get an available subscriptions list:
$list = $unisender->getLists()->getResult();
Create a new subscription:
$sub = new Subscriber($name, $email, $phone); $sub->addTag('something'); $response = $unisender->subscribe($sub, [12315, 14333]); if ($response->isSuccess()) { $personId = $response->getResult()['person_id']; // .... do something with the person id }
Get the "native" API instance:
$api = $unisender->getApi(); $api->doSomethingViaMagicCall();
Tests
Just run phpunit
统计信息
- 总下载量: 7.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD
- 更新时间: 2015-10-28