Download the PHP package wiseadmin/wise-notification without Composer
On this page you can find all versions of the php package wiseadmin/wise-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download wiseadmin/wise-notification
More information about wiseadmin/wise-notification
Files in wiseadmin/wise-notification
Download wiseadmin/wise-notification
More information about wiseadmin/wise-notification
Files in wiseadmin/wise-notification
Vendor wiseadmin
Package wise-notification
Short Description WiseAdmin 多通道消息通知组件 — 支持邮件、短信、钉钉、站内信等通道,提供模板引擎、中间件与事件驱动能力
License Apache-2.0
Homepage https://github.com/hiwiseadmin/wise-notification
Package wise-notification
Short Description WiseAdmin 多通道消息通知组件 — 支持邮件、短信、钉钉、站内信等通道,提供模板引擎、中间件与事件驱动能力
License Apache-2.0
Homepage https://github.com/hiwiseadmin/wise-notification
Please rate this library. Is it a good library?
Informations about the package wise-notification
wiseadmin/wise-notification
ThinkPHP 8 多通道消息通知组件,支持邮件、短信、钉钉、站内信等通道,提供模板、中间件、事件驱动能力。
特性
| 模块 | 说明 |
|---|---|
| 四通道内置 | 邮件(PHPMailer)、短信(阿里云/腾讯云双provider)、钉钉机器人(Webhook + 签名)、站内信 |
| Manager-Driver 模式 | NotificationManager 统一调度,支持注册自定义通道驱动 |
| 消息模板 | NotificationTemplate 模型,支持多语言、变量替换 |
| 同步/异步 | sync() 同步发送,不调用时默认走队列 (SendNotificationJob) |
| 中间件管道 | 可追加 NotificationMiddleware,在发送前后插入自定义逻辑 |
| 批量发送 | batch() 方法,Chunk 分批 + Delay 控制,返回 BatchSendResult |
| 发送历史 | NotificationHistory 模型,记录每次发送结果(状态/耗时/错误) |
| 事件驱动 | NotificationSending / NotificationSent / NotificationFailed |
| 合并配置 | 支持与 ThinkPHP 应用配置递归合并 |
安装
按需安装通道 SDK:
提示:以上通道 SDK 为可选依赖,按实际使用的通道安装即可。
配置
发布配置文件:
配置文件 config/wise-notification.php:
使用指南
1. 接收者模型(Notifiable)
让用户模型实现 Notifiable 接口:
2. 发送通知(Facade)
3. 批量发送
4. 创建消息
5. 异步发送(队列)
默认不调用 sync() 时,通知通过队列异步发送:
6. 依赖注入方式
7. 自定义通道驱动
8. 中间件管道
9. 事件监听
10. 控制台命令
通道配置速查
邮件
| 配置项 | 说明 |
|---|---|
host |
SMTP 服务器地址 |
port |
端口(587 TLS / 465 SSL) |
username / password |
认证凭据 |
encryption |
tls / ssl |
from.address |
发件人邮箱 |
from.name |
发件人名称 |
短信
| Provider | 配置项 | 说明 |
|---|---|---|
| aliyun | access_key_id / access_secret |
RAM 用户 AK |
| aliyun | sign_name |
短信签名 |
| aliyun | template_map |
模版CODE 映射 |
| tencent | secret_id / secret_key |
云 API 密钥 |
| tencent | app_id |
短信应用 ID |
| tencent | sign_name |
短信签名 |
| tencent | template_map |
模版ID 映射 |
钉钉机器人
| 配置项 | 说明 |
|---|---|
webhook_url |
机器人 Webhook 地址 |
secret |
加签密钥(可选,用于安全设置) |
目录结构
License
MIT
All versions of wise-notification with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
topthink/framework Version ^8.0
topthink/think-queue Version ^3.0
topthink/think-migration Version ^3.0
wiseadmin/wise-support Version 1.0.*
topthink/think-orm Version ^3.0
guzzlehttp/guzzle Version ^7.0
ext-json Version *
topthink/framework Version ^8.0
topthink/think-queue Version ^3.0
topthink/think-migration Version ^3.0
wiseadmin/wise-support Version 1.0.*
topthink/think-orm Version ^3.0
guzzlehttp/guzzle Version ^7.0
ext-json Version *
The package wiseadmin/wise-notification contains the following files
Loading the files please wait ...