From de087c7b4a31cb0643d5432ec9d6b26e208baff2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 19 Mar 2014 08:27:27 -0400 Subject: Add send register confirm mail --- modules/auth/mail.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'modules/auth/mail.go') diff --git a/modules/auth/mail.go b/modules/auth/mail.go index 6f6bf20a..cdfcce4f 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) } -- cgit v1.2.3