承接 hosannahighertech/yii2-sms 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hosannahighertech/yii2-sms

最新稳定版本:1.0.1

Composer 安装命令:

composer require hosannahighertech/yii2-sms

包简介

Yii2 component for sending SMS messages

README 文档

README

Send SMS from different gateways. See readme for currently supported gateways

How to use Library

To use the library, simply create Instance of the Sender that you want and send the message. Below is an example to get you started

$sms = new \hosannahighertech\sms\senders\BeemSender([
  'key' => 'YOUR_KEY_FROM_BEEM
      'secret' => 'YOUR_SECRET_HERE',
  ]);

 $sms->send('SENDER_NAME_OR_NUMBER', ['255....', '255....'], 'Hi, Test Message from Yii2 SMS');

Events

This library support two events: beforeSend which gives you the SMS that will be sent as a payload and afterSend which gives you result from the backend. Here is an example on adding event handlers to the above example

$sms = new \hosannahighertech\sms\senders\BeemSender([
  'key' => 'YOUR_KEY_FROM_BEEM
      'secret' => 'YOUR_SECRET_HERE',
  ]);
  
  $sender->on(SmsSenderInterface::EVENT_BEFORE_SEND, function (SMSEvent $event) {
      $event->message; //this is SMS Object that was sent to the server. Handy to log things if you turned off loggin
  });
  
  $sender->on(SmsSenderInterface::EVENT_AFTER_SEND, function (SMSEvent $event) {
      $event->message; //this is data that comes from backend. For Beem, it is request_id
  });

 $sms->send('SENDER_NAME_OR_NUMBER', ['255....', '255....'], 'Hi, Test Message from Yii2 SMS');

Supported Gateways

统计信息

  • 总下载量: 52
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固