rc2c/the-callr-bundle

为 Symfony2 使用的 TheCallR SDK 套件。

安装: 144

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 4

分支: 1

开放问题: 1

类型:symfony-bundle

dev-master 2014-05-05 13:53 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:39:24 UTC


README

先决条件

  • PHP >= 5.2.0
  • PHP JSON 扩展
  • PHP cURL 扩展

安装

获取套件

使用 composer

{
    "require": {
        "rc2c/the-callr-bundle": "dev-master"
    }
}

初始化套件

要开始使用套件,请将套件注册到您应用程序的内核类中

// 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'

代码示例

// 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');
}

文档 TheCallr API

http://thecallr.com/docs/