2017 © Pedro Peláez
 

library emaildirect

Php wrapper for email direct

image

maxlapko/emaildirect

Php wrapper for email direct

  • Saturday, January 25, 2014
  • by maxlapko
  • Repository
  • 2 Watchers
  • 3 Stars
  • 670 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

# emaildirect

A php library which implements the complete functionality of the REST Email Direct API., (*1)

Installation

Composer install

add package to require section, (*2)

require: "maxlapko/emaildirect": "dev-master"

composer update, (*3)

Plain install

Download package code, (*4)

require_once 'EmailDirect.php'; EmailDirect::register(true);, (*5)

Examples

Retrieve a list of all your publications.

$apiKey = '...';
$emailDirect = new EmailDirect($apiKey);
$response = $emailDirect->publications()->all();
// the respone instance of EmailDirect_Response class, it has ArrayAccess interface
if ($response->success()) {
    $data = $response->getData(); // return array
    // or $publications = $response->Publications; return all publications as array
    foreach ($data['Publications'] as $publication) {
        echo $publication['PublicationID'] . ': ' . $publication['Name'] . PHP_EOL;
    }
} else {
    echo $response->getErrorMessage();
}

Results in:, (*6)

1: Publication One
2: Publication Two

Retrieve a creative list.

$creatives = $emailDirect->creatives();
if ($creatives->all()->Items as $creative) {
    $details = $creatives->setId($creative['CreativeID'])->details();
    echo $details->HTML;
}

Create, then remove a Publication

$response = $emailDirect->publications()->create('Test', array('Description' => 'Test Publication'));
if ($response->success()) {
    $data = $response->getData();
    $emailDirect->publications($data['PublicationID'])->delete();
}

Updating a subscriber's custom fields

$emailDirect->subscribers('email@email.com').update(array('Publications' => array(3)));

When creating a subscriber, (*7)

$response = $emailDirect->subscribers->create($email, array(
    'Publications' => array(1), 
    'CustomFields' => array('FirstName' => 'Max', 'LastName' => 'Lapko')
));

Credits

  • Max Lapko

The Versions

25/01 2014

dev-master

9999999-dev http://docs.emaildirect.com

Php wrapper for email direct

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.0
  • ext-curl *

 

api email

23/01 2014

0.0.1

0.0.1.0 http://docs.emaildirect.com

Php wrapper for email direct

  Sources   Download

The Requires

  • php >=5.3.0

 

api email