InvenTree + pushplus:库存告警推到微信
效果:低库存、到货或库存规则触发时,微信收到提醒。
前置条件
- 一个 pushplus token(官网扫码获取)
- InvenTree 管理员(能改通知、插件或服务器脚本)
InvenTree 通知插件若只 POST 自己的 JSON,不会自动变成 title / content。
配置步骤
方式一:通知 Webhook
在 Settings → Notifications / Plugins 里找到 Webhook 或自定义 HTTP(菜单文案因版本而异)。
能自定义请求体时,POST https://www.pushplus.plus/send:
{
"token": "你的token",
"title": "InvenTree 库存告警",
"content": "有库存规则触发,请打开 InvenTree 查看",
"template": "markdown"
}
只能填一个 URL 时,用固定文案:
https://www.pushplus.plus/send?token=你的token&title=InvenTree库存告警&content=请打开InvenTree查看详情
把该通知绑到低库存、采购到货等事件。
方式二:规则脚本 curl
库存规则或服务器端脚本在触发时:
curl -s -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d '{"token":"你的token","title":"低库存","content":"请打开 InvenTree 处理补货","template":"markdown"}'
完整参数见 消息接口文档。需要解析官方通知原文时,可用会员 预处理。
验证
curl -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d '{"token":"你的token","title":"InvenTree 配置测试","content":"token 可用","template":"markdown"}'
返回 code 为 200 后,用「测试通知」或把某物料阈值调到必触发。
常见问题
每笔库存流水都推? 只绑低库存 / 错误类规则,不要绑所有 stock 事件。见 接口限制。
实例出网失败? 确认 InvenTree 容器能访问 www.pushplus.plus。
收不到消息见 排查说明。