Skip to content
Closed

fix ci #9958

Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/mailer/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, tos []string, fromMent

var mailBody bytes.Buffer

if err := bodyTemplates.ExecuteTemplate(&mailBody, string(tplName), mailMeta); err != nil {
if err := bodyTemplates.ExecuteTemplate(&mailBody, string(tplName+"-body"), mailMeta); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary. bodyTemplates already contains templates for bodies only. This would generate names like "issue/new-body", which should not exist (and the function would leave mailBody empty).

It might be a little confusing that the log is written like:

log.Error("ExecuteTemplate [%s]: %v", string(tplName)+"/body", err)

Which suggest there is such thing as "issue/new/body", but in reality the name of the template is "issue/new" (or "issue/default") for both subject and body. The log says +"/body" only so the user knows which part of the template is failing.

log.Error("ExecuteTemplate [%s]: %v", string(tplName)+"/body", err)
}

Expand Down