mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add send register confirm mail
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user