使用 Yii Dream Team 的 PHP 类来操作 SMS.ru API

3.2.0 2016-05-05 09:34 UTC

This package is auto-updated.

Last update: 2024-09-17 19:36:30 UTC


README

使用 sms.ru API 的 PHP 类,由 Yii Dream Team 提供。这是 Aleksandr Zelenin 的 sms_ru 类的改进和重构版本。

安装

通过 composer 安装此扩展是首选方式。

运行

php composer.phar require --prefer-dist yii-dream-team/smsru "*"

"yii-dream-team/smsru": "*"

将以下内容添加到您的 composer.json 文件的 require 部分。

使用方法

授权

$api = new \yiidreamteam\smsru\Api($apiId);

发送短信

$api->send('79112223344', 'Text message');
$api->send('79112223344,79115556677,79118889900', 'Text message');
$api->send('79112223344', 'Text message', 'Sender', time(), $transliteration = false, $test = true);

发送多条短信

$messages = [
    ['79112223344', 'Text message'],
    ['79115556677', 'Text message #2']
];
$api->sendMultiple($messages, 'Sender', time(), $transliteration = false, $test = true);

短信状态

$api->status('SMS id');

短信费用

$api->cost('79112223344', 'Text message');

余额

$api->balance();

每日限制

$api->limit();

发送者

$api->senders();

将号码添加到停用列表

$api->stopListAdd('79112223344', 'Some note');

从停用列表中移除号码

$api->stopListDel('79112223344');

获取停用列表

$api->stopListGet();

许可

MIT

链接