罗展丰
Published on 2025-11-28 / 35 Visits
0
0

消息推送开发文档

前置条件

部署kernel-biz服务

部署public-ui

配置application.yml,配置发件人邮箱

  • username:邮箱地址

  • passeword:密码

  • smtp-host:SMTP 服务器地址,网易: smtp.qiye.163.com;企业微信邮箱:smtp.exmail.qq.com

  • smtp-port:SMTP 服务器端口

message:
  username: xxx@nationstar.com
  password: xxx
  smtp-host: smtp.qiye.163.com
  smtp-port: 465

分配【消息策略】和【消息模板】菜单权限

使用方法

消息模板

  • 发送方式:目前只支持邮件和企业微信机器人

  • 模板内容:大括号可配置内容的变量,如:{status}

消息策略

  • 策略可以绑定多个模板

  • 策略启用后才能被使用

推送消息

调用kernel的api:根据策略发送消息

url:/v1/message-send/by-strategy

方法:post

传参结构:json

传参说明:

  • strategyCode:策略编码,必填

  • userList:用户列表,结构为数组

  • userList.userId:用户id

  • userList.phone:用户手机号

  • userList.email:用户邮件

  • variables:模板的配置参数,结构为map

  • webhookUrlList:回调地址,结构为List<String>,用于企业微信机器人

传参示例:

{
  "strategyCode": "ttt",
  "userList": [
    {
      "email": "xxx@chinasie.com"
    }
  ],
  "variables": {
    "name": "测试邮件发送"
  }
}
 


Comment