gergelypolonkai/smssender-bundle

此包的最新版本(dev-master)没有可用的许可证信息。

Symfony2 扩展包,用于与 gergelypolonkai/smssender 交互

dev-master 2012-12-20 18:13 UTC

This package is not auto-updated.

Last update: 2024-09-28 13:56:25 UTC


README

此扩展包与 gergelypolonkai/smssender 集成,通过 gergelypolonkai/smsgateway 发送 SMS 信息。

安装

只需将 gergelypolonkai/smssender-bundle 添加到您的 Symfony2 项目的 composer.json 文件中,并运行

php composer.phar update

配置

所有配置都可以通过 Symfony 项目的配置文件进行。在 YML 格式下,可能的配置项有

gergely_polonkai_sms_sender:

    # This must be set, as it has no default value
    sender_url: https:///smsgateway

    # The username/password to use to login to SmsGateway. No default values
    # are available, either
    username: gateway-user
    password: gateway-password

    # This defaults to true. You should set this to false if you use
    # self-signed certificates
    verify_ssl: true

    # This is the default value. Currently SmsGateway requires this to be
    # be set to application/json
    content_type: application/json

    # The content-encoding of the data you send to the server. This must be
    # UTF-8 if you want to send an SMS with non-ascii characters.
    content-encoding: utf-8

    # This should be turned on only for debugging purposes. It makes CURL to
    # log every traffic it makes with SmsGateway.
    verbose_curl: false

使用方法

所有操作都是通过 gergely_polonkai_sms_sender.sender 服务完成的。

$sender = $container->get('gergely_polonkai_sms_sender.sender');
$sender->login();
$sender->send('+155523456789', 'Hello world!', array());
$sender->logout();