Skip to content

Commit

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

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

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

0 comments on commit 28d5420

Please sign in to comment.