diff options
Diffstat (limited to 'modules/auth/mail.go')
-rw-r--r-- | modules/auth/mail.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/auth/mail.go b/modules/auth/mail.go index 6f6bf20a06..cdfcce4f99 100644 --- a/modules/auth/mail.go +++ b/modules/auth/mail.go @@ -16,7 +16,7 @@ import ( // create a time limit code for user active func CreateUserActiveCode(user *models.User, startInf interface{}) string { hours := base.Service.ActiveCodeLives / 60 - data := fmt.Sprintf("%d", user.Id) + user.Email + user.LowerName + user.Passwd + user.Rands + data := base.ToStr(user.Id) + user.Email + user.LowerName + user.Passwd + user.Rands code := base.CreateTimeLimitCode(data, hours, startInf) // add tail hex username @@ -32,11 +32,10 @@ func SendRegisterMail(user *models.User) { data := mailer.GetMailTmplData(user) data["Code"] = code body := base.RenderTemplate("mail/auth/register_success.html", data) - _, _, _ = code, subject, body - // msg := mailer.NewMailMessage([]string{user.Email}, subject, body) - // msg.Info = fmt.Sprintf("UID: %d, send register mail", user.Id) + msg := mailer.NewMailMessage([]string{user.Email}, subject, body) + msg.Info = fmt.Sprintf("UID: %d, send register mail", user.Id) - // // async send mail - // mailer.SendAsync(msg) + // async send mail + mailer.SendAsync(msg) } |