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) {
6464 bodyTemplates := template .New ("" )
6565
6666 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 )
6875
6976 assetFS := AssetFS ()
7077 refreshTemplates := func (firstRun bool ) {
You can’t perform that action at this time.
0 commit comments