forked from forgejo/forgejo
Add send register confirm mail
This commit is contained in:
parent
fbbae2b721
commit
de087c7b4a
10 changed files with 204 additions and 28 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue