File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,14 @@ func Mailer(ctx context.Context) (*texttmpl.Template, *template.Template) {
64
64
bodyTemplates := template .New ("" )
65
65
66
66
subjectTemplates .Funcs (mailSubjectTextFuncMap ())
67
- bodyTemplates .Funcs (NewFuncMap ())
67
+ // 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 )
68
75
69
76
assetFS := AssetFS ()
70
77
refreshTemplates := func (firstRun bool ) {
You can’t perform that action at this time.
0 commit comments