承接 laravel-notification-channels/cmsms 相关项目开发

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

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

laravel-notification-channels/cmsms

Composer 安装命令:

composer require laravel-notification-channels/cmsms

包简介

CMSMS notification channel for Laravel 5 and up

README 文档

README

Latest Version on Packagist run-tests Total Downloads

This package makes it easy to send CMSMS messages with Laravel.

Contents

Requirements

  • Sign up for a online sms gateway account
  • Find your API key in account settings

Installation

You can install the package via composer:

composer require laravel-notification-channels/cmsms

This package will register itself automatically with Laravel 5.5 and up trough Package auto-discovery.

Manual installation

You can install the service provider for Laravel 5.4 and below:

// config/app.php
'providers' => [
    ...
    NotificationChannels\Cmsms\CmsmsServiceProvider::class,
],

Setting up your CMSMS account

Add your CMSMS Product Token and default originator (name or number of sender) to your config/services.php:

// config/services.php
...
'cmsms' => [
    'product_token' => env('CMSMS_PRODUCT_TOKEN'),
    'originator' => env('CMSMS_ORIGINATOR'),
],
...

Notice: The originator can contain a maximum of 11 alphanumeric characters.

Usage

Now you can use the channel in your via() method inside the notification:

use NotificationChannels\Cmsms\CmsmsMessage;
use Illuminate\Notifications\Notification;

class VpsServerOrdered extends Notification
{
    public function via($notifiable)
    {
        return ['cmsms'];
    }

    public function toCmsms($notifiable)
    {
        return CmsmsMessage::create("Your {$notifiable->service} was ordered!");
    }
}

In order to let your Notification know which phone numer you are targeting, add the routeNotificationForCmsms method to your Notifiable model.

Important note: CMCMS requires the recipients phone number to be in international format. For instance: 0031612345678

public function routeNotificationForCmsms()
{
    return '0031612345678';
}

Available message methods

  • body(''): Accepts a string value for the message body.
  • originator(''): Accepts a string value between 1 and 11 characters, used as the message sender name.
  • reference(''): Accepts a string value for your message reference. This information will be returned in a status report so you can match the message and it's status. Restrictions: 1 - 32 alphanumeric characters. Reference will not work for demo accounts.
  • encodingDetectionType(''): Read about encoding detection here: https://developers.cm.com/messaging/docs/sms#auto-detect-encoding
  • multipart($minimum, $maximum): Accepts a 0 to 8 integer range which allows multipart messages. See the documentation from CM for more information.

Available events

  • SMSSentSuccessfullyEvent: This event will be fired after the message was sent. The event will contain the payload we have sent to CM.
  • SMSSendingFailedEvent: This event will be fired if the message was not sent. The event will contain the response body we received from CM.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email michel@enflow.nl instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

Special thanks to Peter Steenbergen for the MessageBird template from where this is mostly based on.

License

The MIT License (MIT). Please see License File for more information.

laravel-notification-channels/cmsms 适用场景与选型建议

laravel-notification-channels/cmsms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24.46k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2016 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 laravel-notification-channels/cmsms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 laravel-notification-channels/cmsms 我们能提供哪些服务?
定制开发 / 二次开发

基于 laravel-notification-channels/cmsms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 3
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-01