We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb42972 commit 28d5420Copy full SHA for 28d5420
modules/templates/mailer.go
@@ -64,7 +64,14 @@ func Mailer(ctx context.Context) (*texttmpl.Template, *template.Template) {
64
bodyTemplates := template.New("")
65
66
subjectTemplates.Funcs(mailSubjectTextFuncMap())
67
- bodyTemplates.Funcs(NewFuncMap())
+ // To do the best to avoid serious breaking, add some functions back for body templates.
68
+ // Keep in mind that some behaviors have changed, for worse case, double-escaping.
69
+ // Custom template users should migrate to the new template system ASAP.
70
+ bodyTemplateFuncMap := NewFuncMap()
71
+ bodyTemplateFuncMap["Safe"] = SafeHTML
72
+ bodyTemplateFuncMap["Escape"] = HTMLEscape
73
+ bodyTemplateFuncMap["Str2html"] = SanitizeHTML
74
+ bodyTemplates.Funcs(bodyTemplateFuncMap)
75
76
assetFS := AssetFS()
77
refreshTemplates := func(firstRun bool) {
0 commit comments