mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-05 01:40:10 +00:00
announcements: {{ .username }}
This commit is contained in:
parent
b10b558358
commit
25a8d3807e
8
email.go
8
email.go
@ -348,12 +348,16 @@ func (emailer *Emailer) constructTemplate(subject, md string, app *appContext, u
|
|||||||
text := stripMarkdown(md)
|
text := stripMarkdown(md)
|
||||||
message := app.config.Section("messages").Key("message").String()
|
message := app.config.Section("messages").Key("message").String()
|
||||||
var err error
|
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),
|
"text": template.HTML(html),
|
||||||
"plaintext": text,
|
"plaintext": text,
|
||||||
"message": message,
|
"message": message,
|
||||||
"md": md,
|
"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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user