aboutsummaryrefslogtreecommitdiff
path: root/modules/auth/mail.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-19 08:27:27 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-19 08:27:27 -0400
commitde087c7b4a31cb0643d5432ec9d6b26e208baff2 (patch)
treed85449d68cea28a6e208dc1a56acda1a50b82a10 /modules/auth/mail.go
parentfbbae2b721c04be740d67b9d227a7578030f93b9 (diff)
Add send register confirm mail
Diffstat (limited to 'modules/auth/mail.go')
-rw-r--r--modules/auth/mail.go11
1 files changed, 5 insertions, 6 deletions
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)
}