easy-message/README.md

55 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 消息通知组件
## 功能
* 监控发送应用异常
* 支持多种通道(钉钉群机器人、飞书群机器人、邮件、QQ 频道机器人、企业微信群机器人)
* 支持扩展自定义通道
## 环境要求
* hyperf >= 2.0
## 安装
```bash
composer require ykxiao/easy-message -vvv
```
## 配置文件
发布配置文件`config/message.php`
```bash
php bin/hyperf.php vendor:publish ykxiao/easy-message
```
## 使用
```php
Notify::make()->setChannel(DingTalkChannel::class)
->setTemplate(Text::class)
->setTitle('标题')->setText('内容')->setAt(['all'])->setPipeline('info')
->send();
```
## 通道
| 通道名称 | 命名空间 | 支持格式 |
|-------|--------------------------------------|---------------|
| 钉钉群 | \EasyMessage\Channel\DingTalkChannel | Text、Markdown |
| 飞书群 | \EasyMessage\Channel\FeiShuChannel | Text、Markdown |
| 企业微信群 | \EasyMessage\Channel\WechatChannel | Text、Markdown |
## 格式
| 格式名称 | 命名空间 |
|----------|----------------------------------|
| Text | \EasyMessage\Template\Text |
| Markdown | \EasyMessage\Template\Markdown |
## 协议
MIT 许可证MIT。有关更多信息请参见[协议文件](LICENSE)。