tecdiary/sms
Composer 安装命令:
composer require tecdiary/sms
包简介
Simple SMS Gateway Package for sending short text messages. Currently Bulksms, Clickatell, Gupshup, Infobip, Itexmo, Mocker, MVaayoo, Nexmo, SmsAchariya, Smsapi, SmsCountry, SmsLane, twilio and Any HTTP/s based Gateways are supported with Custom Gateway. Default Log gateway can be used for testing.
关键字:
README 文档
README
Simple SMS Gateway Package for sending short text messages. Currently Bulksms, Clickatell, Gupshup, Infobip, Itexmo, Mocker, MVaayoo, Nexmo, SmsAchariya, Smsapi, SmsCountry, SmsLane, twilio and Any HTTP/s based Gateways are supported with Custom Gateway. Default Log gateway can be used for testing.
Installation
composer require tecdiary/sms
Usage
Prepare your $config for your sms gateways as below (refer to sampleConfig.php for your sms gateway requirements). Initialize class with config and start sending sms messages $sms->send($mobile, $message);.
use Tecdiary\Sms\Sms; $config = [ 'gateway' => 'Log', 'log' => [ 'path' => __DIR__ . '/logs/sms.log', 'level' => 100 ] ]; $sms = new Sms($config);
Send Single SMS:
$sms->send('+919090909090', 'This is sms body');
Send Multiple SMS:
$sms->send(['+60123456789', '+601111442122'], 'This is sms body');
Gateway Response:
$response = $sms->send(['+60123456789', '+601111442122'], 'This is sms body')->response();
Gateways
Currently these gateways are supported
- Bulksms
- Clickatell
- Gupshup
- Infobip
- Itexmo
- Mocker
- MVaayoo
- Nexmo
- SmsAchariya
- Smsapi
- SmsCountry
- SmsLane
- Twilio
- Custom
Default Gateway: Log
Custom Gateway
Let us suppose you want to use any other gateway. Find the API URL with which SMS can be sent.
For Example : http://example.com/api/sms.php?uid=737262316a&pin=YOURPIN&sender=your_sender_id&route=0&mobile=8888888888&message=How are You&pushid=1
Then you can setup the Config of Custom Gateway like this:
$config = [ 'gateway' => 'Custom', 'Custom' => [ 'url' => 'http://example.com/api/sms.php?', 'params' => [ 'send_to_name' => 'mobile', 'msg_name' => 'message', 'others' => [ 'uid' => '737262316a', 'pin' => 'YOURPIN', 'sender' => 'your_sender_id', 'route' => '0', 'pushid' => '1', ] ] ] ];
Contributing
Any sort of contributions and/or feedback is much appreciated, specially if you have added any new gateway. Just leave an issue or pull-request!
tecdiary/sms 适用场景与选型建议
tecdiary/sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.56k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2018 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「twilio」 「nexmo」 「bulksms」 「clickatell」 「smsapi」 「sms gateway」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tecdiary/sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tecdiary/sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tecdiary/sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A modern, flexible Laravel package for integrating any SMS gateway with REST API support
Laravel 5 package for sending sms in SMS.to
A PHP library to send and receive SMS text messages through various gateways/providers.
Componente para integração com serviços de mensageria com APIs externas como Twilio, SendGrid, AWS SES, etc.
Integrates vonage/client in symfony >= 4
统计信息
- 总下载量: 4.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 38
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-22