appdevelteleup/ongage-lib

This library is an implementation of the Ongage API

dev-master 2017-11-06 21:32 UTC

This package is not auto-updated.

Last update: 2025-06-12 22:51:51 UTC


README

About

This Library is a PHP implementation of the Ongage Email Platform API.

###Features### This library features an implementation of most of the Ongage Documented Endpoints and Methods, as well as un-documented, potentially unsupported, but also very helpful methods.

Currently implemented endpoints:

"Campaign" Package

  • /api/mailings
  • /api/emails

"Esp" Package (Unsupported, Undocumented by Ongage)

  • /api/account_addresses
  • /api/esp_connections
  • /api/esps

"Lists" Package

  • /api/contacts
  • /api/lists/
  • /api/segments
  • /api/list_fields (Unsupported, Undocumented by Ongage)

"Reports" Package

  • /api/reports

Installation

Via Composer

Install composer in your project:

    curl -s https://getcomposer.org/installer | php

Create a composer.json file in your project root:

    {
        "require": {
            "appdevelteleup/ongage-lib": "0.1*"
        }
    }

Install via composer:

    php composer.phar install

Add this line to your application’s code:

    <?php
        require 'vendor/autoload.php';
    ?>

Usage

    <?php
        $list_id = ''; // Set your List ID here
        // Instantiate Ongage Object
        $ongage = new RfgOngage\Ongage('username', 'password', 'account_code');

        // Instantiate Contacts Object
        $contacts = new RfgOngage\Lists\Contacts();

        // Get Contacts for a list
        $contacts->get($list_id);

        // Send Request
        $results = $ongage->send($contacts);

        // Echo raw results
        print_r($results);
    ?>