camoo/sms
Composer 安装命令:
composer require camoo/sms
包简介
CAMOO API Packages
README 文档
README
PHP SMS API Sending SMS via the CAMOO SMS gateway
Requirement
This library needs minimum requirement for doing well on run.
- Sign up for a free CAMOO SMS account
- Ask CAMOO Team for new access_key for developers
- CAMOO SMS API client for PHP requires version 8.1.x and above
Installation via Composer
Package is available on Packagist, you can install it using Composer.
composer require camoo/sms
Or go to
And download the full version
If you want to install a legacy version running with PHP7.4
Run composer with the command below
composer require camoo/sms "3.2.*"
Or Download it from Camoo-SMS-API-Legacy
Quick Examples
Sending a SMS
$oMessage = \Camoo\Sms\Message::create('YOUR_API_KEY', 'YOUR_API_SECRET'); $oMessage->from ='YourCompany'; $oMessage->to = '+237612345678'; $oMessage->message ='Hello Kmer World! Déjà vu!'; var_dump($oMessage->send());
Send the same SMS to many recipients
- Per request, a max of 50 recipients can be entered.
$oMessage = \Camoo\Sms\Message::create('YOUR_API_KEY', 'YOUR_API_SECRET'); $oMessage->from ='YourCompany'; $oMessage->to =['+237612345678', '+237612345679', '+237612345610', '+33689764530']; //OR from version 3.3.0 $collection = new RecipientCollection(); $collection->add('237612345678'); $collection->add('237612345679'); $collection->add('237612345610'); $collection->add('33689764530'); $oMessage->to = $collection; $oMessage->message ='Hello Kmer World! Déjà vu!'; var_dump($oMessage->send());
Sending non customized sender SMS.
$oMessage = \Camoo\Sms\Message::create('YOUR_API_KEY', 'YOUR_API_SECRET'); $oMessage->from ='WhatEver'; // will be overridden $oMessage->to = '+237612345678'; // This parameter tells our system to use the classic route to send your message. $oMessage->route ='classic'; $oMessage->message ='Hello Kmer World! Déjà vu!'; var_dump($oMessage->send());
Sending an encrypted SMS
Encrypt message using GPG before sending, ensure an end to end ecryption between your server and ours
$oMessage = \Camoo\Sms\Message::create('YOUR_API_KEY', 'YOUR_API_SECRET'); $oMessage->from ='YourCompany'; $oMessage->to = '+237612345678'; $oMessage->message ='Hello Kmer World! Déjà vu!'; $oMessage->encrypt = true; var_dump($oMessage->send());
Sending BULK SMS
Send Bulk SMS in background. This call requires shell_exec to be enabled
$oMessage = \Camoo\Sms\Message::create('YOUR_API_KEY', 'YOUR_API_SECRET'); $oMessage->from ='YourCompany'; $oMessage->to = ['+237612345678', '+237612345679', '+237612345610', '+33689764530', '+4917612345671']; $oMessage->message ='Hello Kmer World! Déjà vu!'; var_dump($oMessage->sendBulk());
Sending Personalized BULK SMS
Send Bulk SMS in background. This call requires shell_exec to be enabled
You should use the placeholder %NAME% in your message and the property to should be an associative array containing name and mobile for each element. See the example below
$oMessage = \Camoo\Sms\Message::create('YOUR_API_KEY', 'YOUR_API_SECRET'); $oMessage->from ='YourCompany'; $oMessage->to = [['name' => 'John Doe', 'mobile' => '+237612345678'], ['name' => 'Jeanne Doe', 'mobile' => '+237612345679'], ['...']]; $oMessage->message ='Hello %NAME% Kmer World! Déjà vu!'; var_dump($oMessage->sendBulk());
Top up your SMS account over API
Feature available since version >=3.3.3.
You can top up your Camoo SMS over API using MTN or Orange Mobile Money Cameroon directly from your own application without additional fees.
// Step 1: create Top up instance /** @var TopUp&\Camoo\Sms\Objects\TopUp $topup */ $topup = TopUp::create('YOUR_API_KEY', 'YOUR_API_SECRET'); // Step 2 Assign phone number and amount $topup->amount = 3000; $topup->phonenumber = '612345678'; // Step 3 Call add to top up your account. You will then receive a notification to complete the process. $response = $topup->add(); var_dump($response);
Sending Bulk SMS from your Script
It is obvious that sending bulk data to any system is a problem! Therefore, you should check our recommendation for the best approach
WordPress Plugin
If you are looking for a powerful WordPress plugin to send SMS, then download our wp-camoo-sms
Resources
camoo/sms 适用场景与选型建议
camoo/sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 901 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 12 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「sms gateway」 「bulk sms」 「CAMOO」 「API-SMS」 「GPG SMS encrytion」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 camoo/sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 camoo/sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 camoo/sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
CakePHP behavior plugin for easily generating some complicated queries like (bulk) insert/upsert etc.
Payyo Gateway for the Omnipay payment processing library
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
PHP SDK for Mobile Message SMS API
Extensible library for building notifications and sending them via different delivery channels.
统计信息
- 总下载量: 901
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 21
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-31