Skip to content

Firewards/getrevue-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GetRevue PHP

Unofficial GetRevue PHP API for v2.

This package makes it simple to access GetRevues's web API. Checkout https://www.getrevue.co/api for more information on GetRevue's API.

Source Code Software License

Install

Via Composer

$ composer require firewards/getrevue-php

Requirements

The following versions of PHP are supported.

  • PHP 7.0
  • PHP 7.1
  • PHP 7.2
  • PHP 7.3
  • PHP 7.4

API Key

All API calls require an API Key. You can find your API Key in the GetRevue Account page under the Integrations tab (scroll all the way down).

Usage

Start by using GetRevueAPI and creating an instance with your ConvertKit API key

$apiKey = "your-key-goes-here";
$api = new \Firewards\GetRevueApi($apiKey);

Examples

Add a new email to your list of subscribers.

$subscriber = $this->api->addSubscriber("[email protected]", 'firstName', 'lastName');

/**
Return example:
array(6) {
  ["id"]=>
  int(42840832)
  ["list_id"]=>
  int(64471)
  ["email"]=>
  string(26) "[email protected]"
  ["first_name"]=>
  string(9) "firstName"
  ["last_name"]=>
  string(8) "lastName"
  ["last_changed"]=>
  string(24) "2020-12-24T02:21:26.333Z"
}
 */

Unsubscribe an existing subscriber by email. Revue is not returning any success or failure codes.

if ($api->unsubscribe("[email protected]")) {
    // unsbuscribed
}

Get all subscribers and iterate through them. Revue's API does not support paging, yet. The API will return 5000 subscribers.

foreach ($api->getSubscribers() as $subscriber) {
    /*
     * array(6) {
          ["id"]=>
          int(42840832)
          ["list_id"]=>
          int(64471)
          ["email"]=>
          string(26) "[email protected]"
          ["first_name"]=>
          string(9) "firstName"
          ["last_name"]=>
          string(8) "lastName"
          ["last_changed"]=>
          string(24) "2020-12-24T02:21:26.333Z"
        }
     */
}

Get all available lists (subscriber groups).

foreach ($api->getLists()) {
    
}

Return information about a specific list using its id.

$list = $api->getList(13212);

License

The MIT License (MIT). Please see License File for more information.

Sponsor

www.firewards.com

This package is sponsored by www.firewards.com, Firewards makes it easy to setup a referral and rewards program for your email list and newsletter.