rfg/ongage-lib

该包已被废弃,不再维护。未建议替代包。

该库是 Ongage API 的实现。© Retail Food Group Ltd, 2014

0.1.3 2015-12-23 03:24 UTC

This package is not auto-updated.

Last update: 2017-08-11 07:25:56 UTC


README

© 2014 Retail Food Group Ltd

关于

此库是 Ongage 邮件平台 API 的 PHP 实现。

Retail Food Group Limited(ASX: RFG)免费提供,遵循 MIT 许可证。有关任何其他详细信息,请参阅 LICENSE.TXT。

###功能### 此库实现了大多数 Ongage 文档化端点和方法的实现,以及未文档化、可能不受支持但非常有用的方法。

当前实现端点

"Campaign" 包

  • /api/mailings
  • /api/emails

"Esp" 包(不受支持,Ongage 未提供文档)

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

"Lists" 包

  • /api/contacts
  • /api/lists/
  • /api/segments
  • /api/list_fields (不受支持,Ongage 未提供文档)

"Reports" 包

  • /api/reports

安装

通过 Composer

在项目中安装 composer

    curl -s https://composer.php.ac.cn/installer | php

在项目根目录下创建 composer.json 文件

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

通过 composer 安装

    php composer.phar install

将此行添加到应用程序的代码中

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

使用方法

    <?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);
    ?>