邮件模板中增加LimitTime过期时间字段

This commit is contained in:
wsczx
2024-08-30 19:33:27 +08:00
parent cbdf730481
commit 7160c3cab7
2 changed files with 9 additions and 0 deletions

View File

@@ -220,6 +220,7 @@ type userAccountMailData struct {
Username string
Nickname string
PinCode string
LimitTime string
OtpImg string
OtpImgBase64 string
DisableOtp bool
@@ -276,6 +277,13 @@ func userAccountMail(user *dbdata.User) error {
OtpImgBase64: "data:image/png;base64," + otpData,
DisableOtp: user.DisableOtp,
}
if user.LimitTime == nil {
data.LimitTime = "无限制"
} else {
data.LimitTime = user.LimitTime.Local().Format("2006-01-02")
}
w := bytes.NewBufferString("")
t, _ := template.New("auth_complete").Parse(htmlBody)
err = t.Execute(w, data)