消息模板配置钉钉消息

谷神系统已经集成了钉钉消息,可以在配置消息模板处启用、配置。用此消息模板发送消息时,钉钉已启用会同步发送钉钉消息。

自定义消息(请优先使用消息模板)

若消息模板无法满足需求,可通过代码方式调用钉钉插件,发送消息。

示例:

#set($service=$vs.service.find(‘com.golden.faas.plugins.dingtalk.message.comps.DingTalkMessageComps’))
$service.sendTextMsg(null,$userId,”这是一条文本消息!”))

方法:

  • 文本消息
    sendTextMsg(String systemId, List userIdList, String text)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • text–消息内容
  • 图片消息
    sendImageMsg(String systemId, List userIdList, String path)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • path–谷神系统上传文件后,生成的图片路径
  • 语音消息
    sendVoiceMsg(String systemId, List userIdList, String path, int duration)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • path–谷神系统上传文件后,生成的文件路径
    • duration–音频时长,正整数
  • 文件消息
    sendFileMsg(String systemId, List userIdList, String fileName, String path)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • fileName–文件名
    • path–谷神系统上传文件后,生成的文件路径
  • 链接消息
    sendLinkMsg(String systemId, List userIdList, String url, String path, String title,String text)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • url–跳转地址
    • path–谷神系统上传文件后,生成的图片路径
    • title–标题
    • text–内容
  • OA消息
    sendOaMsg(String systemId, List userIdList, String url, String title, String text,Map<String, String> form)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • url–跳转地址
    • title–标题
    • text–内容
    • form–消息体的表单,最多显示6个,超过会被隐藏。
  • OA消息
    sendOaMsg(String systemId, List userIdList, String url, String path, Map<String, String> head, Map<String, String> body, Map<String, String> form, Map<String, String> rich)
    • systemId–系统id,为空默认当前
    • userIdList–接收消息用户列表
    • url–跳转地址
    • path–图片路径
    • head–消息头部 属性:text(头部标题),bgcolor(背景色)
    • body–消息体 属性:title(正文标题),content(内容),file_count(附件数量),author(作者)
    • form–消息体的表单,最多显示6个,超过会被隐藏。
    • rich–消息体富文本信息 属性:num(数目),unit(单位)
文档更新时间: 2022-08-03 09:06   作者:杜少荣