Exemple #1
0
l<?php 
/**
 * This file contains examples for using the EmailOneApi PHP-SDK.
 *
 *
 *
 *
 */
// require the setup which has registered the autoloader
require_once dirname(__FILE__) . '/setup.php';
// create the lists endpoint:
$endpoint = new EmailOneApi_Endpoint_Lists();
/*===================================================================================*/
// GET ALL ITEMS
$response = $endpoint->getLists($pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
/*===================================================================================*/
// get a single list
$response = $endpoint->getList('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
/*===================================================================================*/
// copy a list
$response = $endpoint->copy('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
<?php

/**
 * This file contains examples for using the EmailOneApi PHP-SDK.
 *
 *
 *
 *
 */
// require the setup which has registered the autoloader
require_once dirname(__FILE__) . '/setup.php';
// create the lists endpoint:
$endpoint = new EmailOneApi_Endpoint_Lists();
// create a new list
// please see countries.php example file for a list of allowed countries/zones for list company
$response = $endpoint->create(array('general' => array('name' => 'My list created from the API', 'description' => 'This is a test list, created from the API.'), 'defaults' => array('from_name' => 'John Doe', 'from_email' => '*****@*****.**', 'reply_to' => '*****@*****.**', 'subject' => 'Hello!'), 'notifications' => array('subscribe' => 'yes', 'unsubscribe' => 'yes', 'subscribe_to' => '*****@*****.**', 'unsubscribe_to' => '*****@*****.**'), 'company' => array('name' => 'John Doe INC', 'country' => 'United States', 'zone' => 'New York', 'address_1' => 'Some street address', 'address_2' => '', 'zone_name' => '', 'city' => 'New York City', 'zip_code' => '10019')));
// and get the response
echo '<pre>';
print_r($response->body);
echo '</pre>';