1
0
forked from wrenn/wrenn

Updated email template for optional name

This commit is contained in:
2026-04-16 00:54:38 +06:00
parent ded9c15f06
commit 970ae2b6b2
3 changed files with 4 additions and 6 deletions

View File

@ -112,7 +112,7 @@ func TestTemplateRenderText(t *testing.T) {
data: EmailData{ data: EmailData{
Message: "Done.", Message: "Done.",
}, },
want: []string{"Done."}, want: []string{"Hello,", "Done."},
}, },
} }

View File

@ -45,11 +45,9 @@
<td style="padding: 40px 44px;"> <td style="padding: 40px 44px;">
<!-- Greeting --> <!-- Greeting -->
{{if .RecipientName}}
<p style="margin: 0 0 20px 0; font-size: 15px; line-height: 1.6; color: #3a3835;"> <p style="margin: 0 0 20px 0; font-size: 15px; line-height: 1.6; color: #3a3835;">
Hello {{.RecipientName}}, Hello{{if .RecipientName}} {{.RecipientName}}{{end}},
</p> </p>
{{end}}
<!-- Message --> <!-- Message -->
<p style="margin: 0 0 24px 0; font-size: 15px; line-height: 1.7; color: #3a3835;"> <p style="margin: 0 0 24px 0; font-size: 15px; line-height: 1.7; color: #3a3835;">

View File

@ -1,6 +1,6 @@
{{if .RecipientName}}Hello {{.RecipientName}}, Hello{{if .RecipientName}} {{.RecipientName}}{{end}},
{{end}}{{.Message}} {{.Message}}
{{if .Button}} {{if .Button}}
{{.Button.Text}}: {{.Button.URL}} {{.Button.Text}}: {{.Button.URL}}