symfony-bundle the-callr-bundle
TheCallR SDK bundle for Symfony2.
rc2c/the-callr-bundle
TheCallR SDK bundle for Symfony2.
- Monday, May 5, 2014
- by rc2c
- Repository
- 3 Watchers
- 1 Stars
- 140 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 2 Forks
- 1 Open issues
- 1 Versions
- 0 % Grown
ThecallrBundle
Prerequisites
- PHP >= 5.2.0
- The PHP JSON extension
- The PHP cURL extension
Installation
Get the bundle
With composer :, (*1)
``` json
{
"require": {
"rc2c/the-callr-bundle": "dev-master"
}
}, (*2)
### Initialize the bundle
To start using the bundle, register the bundle in your application's kernel class:
``` php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// Thecallr
new Rc2c\ThecallrBundle\Rc2cThecallrBundle()
// ...
);
)
rc2c.the_callr.login: 'your_login'
rc2c.the_callr.password: 'your_password'
rc2c.the_callr.sender: 'THECALLR'
Code sample
// Load thecallr service
$sms_Manager = $this->container->get('rc2c.the_callr');
// Your phone number (international format)
$phone = '+33610111213';
// Your message (text)
$message = 'your text message';
try {
// Send sms
$sms_Manager->send($phone, $message);
} catch(Exception $e) {
$this->logMessage($e->getCode().'-'.$e->getMessage(), 'err');
}
Documentation TheCallr API
http://thecallr.com/docs/, (*3)