2017 © Pedro Peláez
 

library everlytic

Provides a simple and elegant wrapper for the Everlytic Bulk Mail API to enable use within laravel framework

image

chencha/everlytic

Provides a simple and elegant wrapper for the Everlytic Bulk Mail API to enable use within laravel framework

  • Wednesday, May 21, 2014
  • by jchencha
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Everlytic API Wrapper

This provides a Laravel wrapper for the everlytic BulkMail API., (*1)

No extra methods have been added to the API., (*2)

The documentation for the API can be found here http://www.everlytic.co.za/features/integration/api-php-library/, (*3)

Installation

  1. Update your composer.json file and this line to your require ***, (*4)

    "chencha/everlytic": "dev-master", (*5)

  2. Run composer update to get the files, (*6)

  3. Register the service provider in your app/config/app.php, (*7)

    'providers' => array(, (*8)

    'Chencha\Everlytic\EverlyticServiceProvider',

    ), (*9)

  4. Register the Facade in app/config/app.php, (*10)

    'aliases' => array(, (*11)

    'Everlytic'=>'Chencha\Everlytic\Facades\Everlytic',

    ), (*12)

  5. Publish your credentials using Artisan CLI, (*13)

    php artisan config:publish chencha/everlytic ***, (*14)

Edit the config file, (*15)

app/config/packages/chencha/everlytic/api.php

Replace the user, url and api key with the ones provided by everlytic, (*16)

Usage

The wrapper provides access to all the underlying functions provided by the php api library., (*17)

Sample usage:, (*18)

<?php
Create a new contact
$contact = array();
$contact['contact_mobile'] = '0726785544';
$contact['contact_email'] = 'bob@test.com';
$contact['contact_name'] = 'bob';
$contact['contact_lastname'] = 'jones';
$listIds = array(
    1 => CONTACT_SUBSCRIPTION_STATUS_SUBSCRIBED,
    2 => CONTACT_SUBSCRIPTION_STATUS_SUBSCRIBED
);
$contact['list_id'] = $listIds;
$contact['on_duplicate'] = CONTACT_ACTION_UPDATE;
$result = Everlytic::createContact($contact);
// Contact - get
$createdContactId = $result['result']['id'];

$gotContact = Everlytic::getContact($createdContactId);

// Contact - getBatch
$filter = array();
$filter['contact_country_id'] = '1';

$page = 1;
$count = 10;
$order = 'contact_name';
$direction = ORDER_ASC;
$result = Everlytic::listContacts($filter, $page, $count, $order, $direction);

// Contact - update
$updates = array();
$updates['contact_name'] = 'test';
$result = Everlytic::updateContact(1, $updates);

// List - getBatch
$filter = array();
$filter['list_name'] = 'none';

$page = 1;
$count = 10;
$order = 'list_name';
$direction = ORDER_ASC;
$result = Everlytic::getLists($filter, $page, $count, $order, $direction);

// List - create
$list = array();
$list['list_name'] = 'testing_list';
$list['list_owner_name'] = 'john';
$list['list_owner_email'] = 'jh@example.com';
$result = Everlytic::createList($list);
$createdListId = $result['id'];

// List - get
$gotList = Everlytic::getList($createdListId);

// Message - getBatch
$filter = array();
$filter['message_type'] = MESSAGE_TYPE_EMAIL;

$page = 1;
$count = 10;
$order = 'message_subject';
$direction = ORDER_ASC;
$result = Everlytic::getMessages($filter, $page, $count, $order, $direction);

// Message - create
$message = array();
$message['message_subject'] = 'a test message';
$message['message_from_email'] = 'message@test.com';
$message['message_from_name'] = 'johnny tester';
$message['message_reply_email'] = 'jt@test.com';
$message['message_type'] = MESSAGE_TYPE_EMAIL;
$result = Everlytic::createMessage($message);
$createdMessageId = $result['id'];

// Message - get
$gotMessage = Everlytic::getMessage($createdMessageId);

// Message - update
$updates = array();
$updates['message_from_name'] = 'Michael';
$result = Everlytic::updateMessage($createdMessageId, $updates);

?>

The Versions

21/05 2014

dev-master

9999999-dev

Provides a simple and elegant wrapper for the Everlytic Bulk Mail API to enable use within laravel framework

  Sources   Download

The Requires

 

by Chencha Jacob

email bulk everlytic