Use TrN helper for email templates (#16425)

* Add TrN helper

* use TrN

* a nit
This commit is contained in:
6543 2021-07-14 15:06:09 +02:00 committed by GitHub
parent 8464fa15d0
commit 8798e3a098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 6 deletions

View file

@ -72,6 +72,7 @@ func sendUserMail(language string, u *models.User, tpl base.TplName, code, subje
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
var content bytes.Buffer
@ -110,6 +111,7 @@ func SendActivateEmailMail(u *models.User, email *models.EmailAddress) {
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
var content bytes.Buffer
@ -136,6 +138,7 @@ func SendRegisterNotifyMail(u *models.User) {
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
var content bytes.Buffer
@ -165,6 +168,7 @@ func SendCollaboratorMail(u, doer *models.User, repo *models.Repository) {
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
var content bytes.Buffer
@ -248,6 +252,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
var mailSubject bytes.Buffer

View file

@ -68,6 +68,7 @@ func mailNewRelease(lang string, tos []string, rel *models.Release) {
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
var mailBody bytes.Buffer

View file

@ -63,6 +63,7 @@ func sendRepoTransferNotifyMailPerLang(lang string, newOwner, doer *models.User,
// helper
"i18n": locale,
"Str2html": templates.Str2html,
"TrN": templates.TrN,
}
if err := bodyTemplates.ExecuteTemplate(&content, string(mailRepoTransferNotify), data); err != nil {