diff --git a/internal/mail/mail.go b/internal/mail/mail.go index 28774c6..19e7631 100644 --- a/internal/mail/mail.go +++ b/internal/mail/mail.go @@ -10,6 +10,7 @@ import ( "embed" "fmt" "html/template" + "time" "github.com/pkg/errors" "gopkg.in/gomail.v2" @@ -49,6 +50,10 @@ func sendTemplateMail(email, title string, templateFS embed.FS, templatePath str if err != nil { return errors.Wrap(err, "parse template file") } + + // General params. + params["year"] = time.Now().Format("2006") + if err := t.Execute(&content, params); err != nil { return errors.Wrap(err, "execute template") } diff --git a/templates/mail/new-answer.html b/templates/mail/new-answer.html index 15b1e30..f4c9199 100644 --- a/templates/mail/new-answer.html +++ b/templates/mail/new-answer.html @@ -101,7 +101,7 @@ 我们向您发送这封邮件来告诉您在 NekoBox 的活动状态,若您未曾使用过 NekoBox,请忽略本邮件。