diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-19 22:03:31 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-19 22:03:31 +0800 |
commit | 42b85a969894e7dbd4273d678b478228155905e2 (patch) | |
tree | d46c0f99c7dd668db8af9f701c7650c0a20dc4a3 /modules/auth/mail.go | |
parent | 89041248d4848038b91d6cffd67120cb4f4cf567 (diff) | |
parent | 56af7e99a819758c6bedc6d745a9f810f3fc050d (diff) |
Merge branch 'master' of https://github.com/gogits/gogs
Diffstat (limited to 'modules/auth/mail.go')
-rw-r--r-- | modules/auth/mail.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/auth/mail.go b/modules/auth/mail.go index cdfcce4f..3de18b67 100644 --- a/modules/auth/mail.go +++ b/modules/auth/mail.go @@ -39,3 +39,20 @@ func SendRegisterMail(user *models.User) { // async send mail mailer.SendAsync(msg) } + +// Send email verify active email. +func SendActiveMail(user *models.User) { + code := CreateUserActiveCode(user, nil) + + subject := "Verify your email address" + + data := mailer.GetMailTmplData(user) + data["Code"] = code + body := base.RenderTemplate("mail/auth/active_email.html", data) + + msg := mailer.NewMailMessage([]string{user.Email}, subject, body) + msg.Info = fmt.Sprintf("UID: %d, send email verify mail", user.Id) + + // async send mail + mailer.SendAsync(msg) +} |