earlhickey/pg-selligent

ZF2 module for Selligent Individual API

1.0 2014-07-29 09:50 UTC

This package is not auto-updated.

Last update: 2024-03-16 13:48:10 UTC


README

ZF2 module for Selligent Individual API

Installation

Main Setup

By cloning project

  1. Install the zf2-selligent ZF2 module by cloning it into ./vendor/.
  2. Clone this project into your ./vendor/ directory.

With composer

  1. Add this project in your composer.json:

    "require": {
        "earlhickey/pg-selligent": "1.*"
    }
  2. Now tell composer to download PgSelligent by running the command:

    $ php composer.phar update

Post installation

  1. Enabling it in your application.config.php file.

    <?php
    return array(
        'modules' => array(
            // ...
            'PgSelligent',
        ),
        // ...
    );
  2. Copy ./vendor/earlhickey/pg-selligent/config/pg-selligent.global.php.dist to ./config/autoload/pg-selligent.global.php and change the values as desired.

Usage

  1. Subscribe

    //  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. Unsubscribe

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