dev-master
9999999-devProvides a simple and elegant wrapper for the Everlytic Bulk Mail API to enable use within laravel framework
The Requires
- php >=5.3.0
- illuminate/support 4.1.*
by Chencha Jacob
email bulk everlytic
Provides a simple and elegant wrapper for the Everlytic Bulk Mail API to enable use within laravel framework
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)
Update your composer.json file and this line to your require ***, (*4)
"chencha/everlytic": "dev-master", (*5)
Run composer update to get the files, (*6)
Register the service provider in your app/config/app.php, (*7)
'providers' => array(, (*8)
'Chencha\Everlytic\EverlyticServiceProvider',
), (*9)
Register the Facade in app/config/app.php, (*10)
'aliases' => array(, (*11)
'Everlytic'=>'Chencha\Everlytic\Facades\Everlytic',
), (*12)
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)
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); ?>
Provides a simple and elegant wrapper for the Everlytic Bulk Mail API to enable use within laravel framework
email bulk everlytic