1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00:00

announcements: {{ .username }}

This commit is contained in:
Harvey Tindall 2021-07-16 19:46:05 +01:00
parent b10b558358
commit 25a8d3807e
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -348,12 +348,16 @@ func (emailer *Emailer) constructTemplate(subject, md string, app *appContext, u
text := stripMarkdown(md)
message := app.config.Section("messages").Key("message").String()
var err error
email.HTML, email.Text, email.Markdown, err = emailer.construct(app, "template_email", "email_", map[string]interface{}{
data := map[string]interface{}{
"text": template.HTML(html),
"plaintext": text,
"message": message,
"md": md,
})
}
if len(username) != 0 {
data["username"] = username
}
email.HTML, email.Text, email.Markdown, err = emailer.construct(app, "template_email", "email_", data)
if err != nil {
return nil, err
}