diff --git a/modules/templates/mailer.go b/modules/templates/mailer.go index 54d857a8f6e..04032e39827 100644 --- a/modules/templates/mailer.go +++ b/modules/templates/mailer.go @@ -44,11 +44,17 @@ func buildSubjectBodyTemplate(stpl *texttmpl.Template, btpl *template.Template, } if _, err := stpl.New(name). Parse(string(subjectContent)); err != nil { - log.Warn("Failed to parse template [%s/subject]: %v", name, err) + log.Error("Failed to parse template [%s/subject]: %v", name, err) + if !setting.IsProd { + log.Fatal("Please fix the mail template error") + } } if _, err := btpl.New(name). Parse(string(bodyContent)); err != nil { - log.Warn("Failed to parse template [%s/body]: %v", name, err) + log.Error("Failed to parse template [%s/body]: %v", name, err) + if !setting.IsProd { + log.Fatal("Please fix the mail template error") + } } } diff --git a/templates/mail/notify/repo_transfer.tmpl b/templates/mail/notify/repo_transfer.tmpl index 597048ddf49..8c8b276484e 100644 --- a/templates/mail/notify/repo_transfer.tmpl +++ b/templates/mail/notify/repo_transfer.tmpl @@ -5,7 +5,7 @@ {{.Subject}} -{{$url := HTMLFormat "%[2]s" .Link .Repo)}} +{{$url := HTMLFormat "%[2]s" .Link .Repo}}

{{.Subject}}. {{.locale.Tr "mail.repo.transfer.body" $url}}