-
Notifications
You must be signed in to change notification settings - Fork 472
feat: 支持 Stencil 模板自定义通知内容 #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 新增结构化通知数据模型(NotificationData、AccountResult、NotificationStats) - 支持通过环境变量或配置文件自定义通知模板 - 新增 notif_config 目录存放各平台默认模板配置
主要针对新增的 Stencil 模板功能,重构了测试用例: - 将 `test_notify.py` 拆分为 `unit` 和 `integration` 目录结构 - `unit` 测试:配置解析、数据模型、发送功能、模板渲染 - `integration` 测试:真实接口测试、路由逻辑验证 - 使用 pytest fixtures 提高测试代码复用性 - 支持参数化测试覆盖多种配置格式
# Conflicts: # notify.py
以及测试相关内容的说明
感谢你的想法和用心。 |
感谢作者的付出🙏 项目本身很实用。 因为我自己用的时候觉得当前的通知内容看起来不太方便,所以干脆自己动手改造一下,顺带回馈社区。 如果有其他人有类似的需求可以尝试一下这个 pr。有问题欢迎随时反馈。 |
我发了一个 Issues #38,超过 20 人需要会进行合并。 |
在本 pr 合并之前,有自定义通知需求的朋友可以考虑 fork 我这个分值,然后将 本分支将定时同步主仓库的更新。
|
我基于本仓库实现了 autocheck-anyrouter,后续本 pr 将不再更新。在此感谢 millylee 的无私奉献。 |
新增内容
本 MR 新增了以下内容:
- Stencil 模板支持
本 MR 为消息通知增加了 Stencil 模板支持,现在可以使用 Stencil 语法,自定义消息通知的样式。
支持环境变量和配置文件两种形式,同时兼容老版本的环境变量。
- 企微通知支持 Markdown
增加对企业微信
markdown
和markdown_v2
类型消息的支持:WECOM_NOTIF_CONFIG
配置示例:效果:

注意事项
当前未针对全部平台进行测试,已测试平台:
详见 README.md 以及 commit list。