earlhickey/pg-selligent

Selligent Individual API 的 ZF2 模块

1.0 2014-07-29 09:50 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:41:27 UTC


README

Selligent Individual API 的 ZF2 模块

安装

主要设置

通过克隆项目

  1. 通过克隆到 ./vendor/ 来安装 zf2-selligent ZF2 模块。
  2. 将此项目克隆到您的 ./vendor/ 目录中。

使用 composer

  1. 在您的 composer.json 中添加此项目

    "require": {
        "earlhickey/pg-selligent": "1.*"
    }
  2. 现在运行命令下载 PgSelligent

    $ php composer.phar update

安装后

  1. 在您的 application.config.php 文件中启用它。

    <?php
    return array(
        'modules' => array(
            // ...
            'PgSelligent',
        ),
        // ...
    );
  2. ./vendor/earlhickey/pg-selligent/config/pg-selligent.global.php.dist 复制到 ./config/autoload/pg-selligent.global.php 并按需更改值。

使用方法

  1. 订阅

    //  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);
  2. 取消订阅

    //  create recipient
    $recipient = new \stdClass();
    $recipient->email = 'johndoe@domain.com';
    
    // Selligent email marketing opt-out
    $unsubscribe = $this->selligent()->unsubscribe($recipient);