boskee/esendex-bundle

Boskee Esendex Bundle for Symfony


Keywords
symfony, sms, bundle, Esendex, boskee
License
MIT

Documentation

Boskee Esendex Bundle

By boskee

Build Status Latest Stable Version Total Downloads

This bundle enables you to use Esendex SDK as a service in your Symfony project.

For more information see the esendex/sdk repository and the Esendex REST API.

Requirements

Installation

Add in your composer.json

{
    "require": {
        "boskee/esendex-bundle": "dev-master"
    }
}

Install the bundle

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update boskee/esendex-bundle

Composer will install the bundle to your project's vendor/boskee directory.

Enable the bundle via the kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Boskee\EsendexBundle\BoskeeEsendexBundle(),
    );
}

Configuration

config.yml

boskee_esendex:
    account_reference: "..."
    username: "..."
    password: "..."

Usage

After installation and configuration, the service can be directly referenced from within your controllers.

<?php

$esendex = $this->get('boskee_esendex.dispatcher');

// Create a Text Message
$message = new Boskee\EsendexBundle\Model\TextMessage();
$message->setOriginator('Boskee');
$message->setRecipient('01234567890');
$message->setBody('Test message');

$response = $esendex->send($message->prepare());

License

This bundle is under the MIT license. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.