消息通知-未定义通知模板或模板不存使用默认模板

This commit is contained in:
linxiaozhi
2019-02-16 22:30:10 +08:00
parent c6bb435f15
commit c3fbd7a321
2 changed files with 17 additions and 1 deletions

View File

@@ -305,7 +305,13 @@ func (j *Job) Run() {
var title = ""
var content = ""
notifyTpl, err := models.NotifyTplGetById(j.task.NotifyTplId)
if err == nil {
if err != nil {
notifyTpl, err := models.NotifyTplGetByTplType(j.task.NotifyType, "system")
if err == nil {
title = notifyTpl.Title
content = notifyTpl.Content
}
} else {
title = notifyTpl.Title
content = notifyTpl.Content
}