earlhickey / pg-selligent
Selligent Individual API 的 ZF2 模块
1.0
2014-07-29 09:50 UTC
Requires
- php: >=5.3.3
- zendframework/zendframework: 2.3.*
- zf-commons/zfc-base: 0.1.*
This package is not auto-updated.
Last update: 2024-09-28 16:41:27 UTC
README
Selligent Individual API 的 ZF2 模块
安装
主要设置
通过克隆项目
- 通过克隆到
./vendor/来安装 zf2-selligent ZF2 模块。 - 将此项目克隆到您的
./vendor/目录中。
使用 composer
-
在您的 composer.json 中添加此项目
"require": { "earlhickey/pg-selligent": "1.*" }
-
现在运行命令下载 PgSelligent
$ php composer.phar update
安装后
-
在您的
application.config.php文件中启用它。<?php return array( 'modules' => array( // ... 'PgSelligent', ), // ... );
-
将
./vendor/earlhickey/pg-selligent/config/pg-selligent.global.php.dist复制到./config/autoload/pg-selligent.global.php并按需更改值。
使用方法
-
订阅
// create recipient $recipient = new \stdClass(); $recipient->firstname = 'John'; $recipient->lastname = 'Doe'; $recipient->gender = ''; $recipient->dateOfBirth = ''; $recipient->email = 'johndoe@domain.com'; // Selligent email marketing opt-in $subscribe = $this->selligent()->subscribe($recipient);
-
取消订阅
// create recipient $recipient = new \stdClass(); $recipient->email = 'johndoe@domain.com'; // Selligent email marketing opt-out $unsubscribe = $this->selligent()->unsubscribe($recipient);