Skip to content

Commit

Permalink
fix approval notification panic
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zhao <[email protected]>
  • Loading branch information
PetrusZ committed Nov 15, 2024
1 parent 812e203 commit 834d0e6
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ func (w *Service) getApproveNotificationContent(notify *models.NotifyCtl, task *
TaskCreatorEmail: task.TaskCreatorEmail,
}

tplTitle := "{if and (ne .WebHookType \"feishu\") (ne .WebHookType \"wechat\")}}### {{end}}{{if eq .WebHookType \"dingding\"}}<font color=#3270e3>**{{end}}{{getIcon .Task.Status }}工作流 {{.Task.WorkflowDisplayName}} #{{.Task.TaskID}} 等待审批{{if eq .WebHookType \"dingding\"}}**</font>{{end}} \n"
tplTitle := "{{if and (ne .WebHookType \"feishu\") (ne .WebHookType \"wechat\")}}### {{end}}{{if eq .WebHookType \"dingding\"}}<font color=#3270e3>**{{end}}{{getIcon .Task.Status }}工作流 {{.Task.WorkflowDisplayName}} #{{.Task.TaskID}} 等待审批{{if eq .WebHookType \"dingding\"}}**</font>{{end}} \n"
mailTplTitle := "{{getIcon .Task.Status }}工作流 {{.Task.WorkflowDisplayName}} #{{.Task.TaskID}} 等待审批\n"

tplBaseInfo := []string{"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}**{{end}}执行用户{{if ne .WebHookType \"wechat\"}**{{end}}:{{.Task.TaskCreator}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}**{{end}}项目名称{{if ne .WebHookType \"wechat\"}**{{end}}:{{.Task.ProjectName}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}**{{end}}开始时间{{if ne .WebHookType \"wechat\"}**{{end}}:{{ getStartTime .Task.StartTime}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}**{{end}}持续时间{{if ne .WebHookType \"wechat\"}**{{end}}:{{ getDuration .TotalTime}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}**{{end}}备注{{if ne .WebHookType \"wechat\"}**{{end}}:{{.Task.Remark}} \n",
tplBaseInfo := []string{"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}}**{{end}}执行用户{{if ne .WebHookType \"wechat\"}}**{{end}}:{{.Task.TaskCreator}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}}**{{end}}项目名称{{if ne .WebHookType \"wechat\"}}**{{end}}:{{.Task.ProjectName}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}}**{{end}}开始时间{{if ne .WebHookType \"wechat\"}}**{{end}}:{{ getStartTime .Task.StartTime}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}}**{{end}}持续时间{{if ne .WebHookType \"wechat\"}}**{{end}}:{{ getDuration .TotalTime}} \n",
"{{if eq .WebHookType \"dingding\"}}##### {{end}}{{if ne .WebHookType \"wechat\"}}**{{end}}备注{{if ne .WebHookType \"wechat\"}}**{{end}}:{{.Task.Remark}} \n",
}
mailTplBaseInfo := []string{"执行用户:{{.Task.TaskCreator}} \n",
"项目名称:{{.Task.ProjectName}} \n",
Expand Down

0 comments on commit 834d0e6

Please sign in to comment.