diff --git a/server/mail/invite.go b/server/mail/invite.go index 599ba6aae..2a9d8b960 100644 --- a/server/mail/invite.go +++ b/server/mail/invite.go @@ -3,6 +3,7 @@ package mail import ( "bytes" "html/template" + "time" "github.com/fleetdm/fleet/v4/server" "github.com/fleetdm/fleet/v4/server/fleet" @@ -11,13 +12,15 @@ import ( // InviteMailer is used to build an email template for the invite email. type InviteMailer struct { *fleet.Invite - BaseURL template.URL - AssetURL template.URL - InvitedBy string - OrgName string + BaseURL template.URL + AssetURL template.URL + InvitedBy string + OrgName string + CurrentYear int } func (i *InviteMailer) Message() ([]byte, error) { + i.CurrentYear = time.Now().Year() t, err := server.GetTemplate("server/mail/templates/invite_token.html", "email_template") if err != nil { return nil, err diff --git a/server/mail/mail.go b/server/mail/mail.go index e4a379e19..8e5ea5c7e 100644 --- a/server/mail/mail.go +++ b/server/mail/mail.go @@ -275,11 +275,13 @@ func dialTimeout(addr string, tlsConfig *tls.Config) (client *smtp.Client, err e // SMTPTestMailer is used to build an email message that will be used as // a test message when testing SMTP configuration type SMTPTestMailer struct { - BaseURL template.URL - AssetURL template.URL + BaseURL template.URL + AssetURL template.URL + CurrentYear int } func (m *SMTPTestMailer) Message() ([]byte, error) { + m.CurrentYear = time.Now().Year() t, err := server.GetTemplate("server/mail/templates/smtp_setup.html", "email_template") if err != nil { return nil, err diff --git a/server/mail/templates/change_email_confirmation.html b/server/mail/templates/change_email_confirmation.html index 37aa99226..7c0e5c936 100644 --- a/server/mail/templates/change_email_confirmation.html +++ b/server/mail/templates/change_email_confirmation.html @@ -162,7 +162,7 @@
- © 2022 Fleet Device Management Inc.
+ © {{.CurrentYear}} Fleet Device Management Inc.
All trademarks, service marks, and company names are the
property of their respective owners.
- © 2022 Fleet Device Management Inc.
+ © {{.CurrentYear}} Fleet Device Management Inc.
All trademarks, service marks, and company names are the
property of their respective owners.
- © 2022 Fleet Device Management Inc.
+ © {{.CurrentYear}} Fleet Device Management Inc.
All trademarks, service marks, and company names are the
property of their respective owners.
- © 2022 Fleet Device Management Inc.
+ © {{.CurrentYear}} Fleet Device Management Inc.
All trademarks, service marks, and company names are the
property of their respective owners.