mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 09:31:11 -05:00
Fix mail template error (#29410)
(cherry picked from commit eb2fc1818b00b7ca6f8c21bb490a8e8be1e62f9a)
This commit is contained in:
parent
ef95d1d533
commit
8f3ef5aa71
2 changed files with 9 additions and 3 deletions
|
@ -44,11 +44,17 @@ func buildSubjectBodyTemplate(stpl *texttmpl.Template, btpl *template.Template,
|
||||||
}
|
}
|
||||||
if _, err := stpl.New(name).
|
if _, err := stpl.New(name).
|
||||||
Parse(string(subjectContent)); err != nil {
|
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).
|
if _, err := btpl.New(name).
|
||||||
Parse(string(bodyContent)); err != nil {
|
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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<title>{{.Subject}}</title>
|
<title>{{.Subject}}</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
{{$url := HTMLFormat "<a href='%[1]s'>%[2]s</a>" .Link .Repo)}}
|
{{$url := HTMLFormat "<a href='%[1]s'>%[2]s</a>" .Link .Repo}}
|
||||||
<body>
|
<body>
|
||||||
<p>{{.Subject}}.
|
<p>{{.Subject}}.
|
||||||
{{.locale.Tr "mail.repo.transfer.body" $url}}
|
{{.locale.Tr "mail.repo.transfer.body" $url}}
|
||||||
|
|
Loading…
Reference in a new issue