aglipanci / interspire
轻松实现 Interspire API 集成
dev-master
2014-10-23 13:26 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-09-23 03:14:54 UTC
README
轻松实现 Interspire API 集成
安装
将 laravel-interspire 添加到您的 composer.json 文件中
"require": {
"aglipanci/interspire": "dev-master"
}
使用 composer 安装此包。
$ composer update
注册包
在 app/config/app.php
文件中的 providers
数组中注册服务提供者
'providers' => array( // ... 'Aglipanci\Interspire\InterspireServiceProvider', )
在 app/config/app.php
文件中的 aliases
数组中添加别名
'aliases' => array( // ... 'Interspire' => 'Aglipanci\Interspire\Facades\Interspire', )
配置
使用 artisan 命令为包创建配置文件
$ php artisan config:publish aglipanci/interspire
然后编辑配置文件,输入您的 Interspire API URL、用户名和令牌。
用法
基本用法
要将新的订阅者添加到列表,您需要添加姓名、姓氏、电子邮件和列表 ID(从 interspire 获取);
Interspire::addSubscriberToList('John', 'Smith', 'jsmith@gmail.com', 1);
要删除现有的订阅者,您只需要电子邮件地址
Interspire::deleteSubscriber('jsmith@gmail.com');
要检查订阅者是否已在特定的列表中
Interspire::isOnList('jsmith@gmail.com', 2)