Skip to content

Commit faa8065

Browse files
committed
fix(backend): update welcome.html template
1 parent e29bf1d commit faa8065

2 files changed

Lines changed: 294 additions & 470 deletions

File tree

backend/services/email/templates.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"os"
1717
"path/filepath"
1818
"runtime"
19+
"strings"
1920
)
2021

2122
// WelcomeEmailData contains data for welcome email template
@@ -99,8 +100,14 @@ func (ts *TemplateService) renderTemplate(templateName string, data interface{})
99100
return "", fmt.Errorf("failed to read template file %s: %w", templatePath, err)
100101
}
101102

103+
// Create template with custom functions
104+
funcMap := template.FuncMap{
105+
"lower": strings.ToLower,
106+
"upper": strings.ToUpper,
107+
}
108+
102109
// Parse template
103-
tmpl, err := template.New(templateName).Parse(string(templateContent))
110+
tmpl, err := template.New(templateName).Funcs(funcMap).Parse(string(templateContent))
104111
if err != nil {
105112
return "", fmt.Errorf("failed to parse template %s: %w", templateName, err)
106113
}

0 commit comments

Comments
 (0)