Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Feb 25, 2024
1 parent d2f6588 commit 0043652
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/templates/mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ func Mailer(ctx context.Context) (*texttmpl.Template, *template.Template) {
bodyTemplates := template.New("")

subjectTemplates.Funcs(mailSubjectTextFuncMap())
bodyTemplates.Funcs(NewFuncMap())
// To do the best avoid serious breaking, add some functions back for body templates
// Keep in mind that some behaviors have changed, for worse case, double-escaping
bodyTemplateFuncMap := NewFuncMap()
bodyTemplateFuncMap["Safe"] = SafeHTML
bodyTemplateFuncMap["Escape"] = HTMLEscape
bodyTemplates.Funcs(bodyTemplateFuncMap)

assetFS := AssetFS()
refreshTemplates := func(firstRun bool) {
Expand Down

0 comments on commit 0043652

Please sign in to comment.