承接 infinitypaul/laravel-notification-channel-termii 相关项目开发

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

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

infinitypaul/laravel-notification-channel-termii

Composer 安装命令:

composer require infinitypaul/laravel-notification-channel-termii

包简介

Termii SMS/Whatsapp Channel for Laravel

README 文档

README

This package brings you the joy of sending Termii notifications with Laravel, with the same effortlessness as a Sunday morning coffee. Take a sip and let's get started.

Contents

Installation

You can install the package faster than you can say "composer" via composer:

composer require infinitypaul/laravel-notification-channel-termii

Service providers... You gotta love them. You either have to install them yourself, or if you're living on the edge with Laravel 5.5 or higher, let the package auto discovery do the work for you:

// config/app.php
'providers' => [
    ...
    Infinitypaul\Termii\TermiiServiceProvider::class,
],

Setting up your Termii account

Time to tell Laravel your deepest secret (aka your Termii API Key). Also, add your favorite channel and an optional Sender ID. Whisper these to your config/services.php:

// config/services.php
'termii' => [
'api_key' => env('TERMII_API_KEY'),
'from' => env('TERMII_FROM'),
'channel' => 'dnd' //because I know you love 'do not disturb' mode 😉
]

Usage

The next step is as easy as pie. Simply use the channel in your via() method inside the notification:

use Infinitypaul\Termii\TermiiChannel;
use Infinitypaul\Termii\TermiiMessage;
use Illuminate\Notifications\Notification;

class WelcomeSMS extends Notification
{
    public function via($notifiable)
    {
        return [TermiiChannel::class]; // see? pie!
    }

    public function toTermii($notifiable)
    {
        return (new TermiiMessage())
            ->content("Thanks For Subscribing to infinitypaul.medium.com. We promise to only send interesting stuff, no cat videos... well, maybe just one.");
    }
}

Let's tell your Notification where it's heading(which phone are you sending to). Add the routeNotificationForTermii method to your Notifiable model (e.g., your User Model).

public function routeNotificationForTermii()
{
    return $this->phone; // where `phone` is a field in your users table;
}

or you can also just send it from TermiiMessage class in your toTermii() implementation.

public function toTermii($notifiable)
    {
        return (new TermiiMessage())
            ->content("Thanks For Subscribing to infinitypaul.medium.com. We promise to only send interesting stuff, no cat videos... well, maybe just one.")
            ->to("234100000001");
    }

Available Message methods

TermiiMessage

  • from(''): Accepts a string -Represents a sender ID for sms which can be Alphanumeric or Device name for Whatsapp. Alphanumeric sender ID length should be between 3 and 11 characters (Example:CompanyName).
  • to(''): Accepts a string - Represents a destination ID for sms in international format (Example: 2338013828492). It is optional, and can be set in the notifable model routeNotificationForTermii().
  • content(''): Accepts a string - Text of a message that would be sent to the destination phone number.
  • channel(''): Accepts a string This is the route through which the message is sent. It is either dnd, whatsapp, or generic, by default it is dnd.
  • media(''): Accepts an array, if your channel is whatsapp This is a media object, it is only available for the High Volume WhatsApp. When using the media parameter, ensure you are not using the sms parameter.
  • media_url(''): Accepts a string, if your channel is whatsapp The url to the file resource,.
  • media_option(''): Accepts a string, if your channel is whatsapp The caption that should be added to the image,.

Changelog

Curious about our termii journey? Check out CHANGELOG for more information on what has changed recently.

Testing

composer test //(We promise it won't explode.)

Security

Discovered any security issues? Please email us at infinitypaul@live.com. We promise to take it seriously, instead of using the issue tracker..

Credits

License

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

infinitypaul/laravel-notification-channel-termii 适用场景与选型建议

infinitypaul/laravel-notification-channel-termii 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.39k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2023 年 06 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 5.39k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-17