SendActivateAccountMail sends confirmation email.
(c *macaron.Context, u User, email string)
| 128 | |
| 129 | // SendActivateAccountMail sends confirmation email. |
| 130 | func SendActivateEmailMail(c *macaron.Context, u User, email string) { |
| 131 | data := map[string]any{ |
| 132 | "Username": u.DisplayName(), |
| 133 | "ActiveCodeLives": conf.Auth.ActivateCodeLives / 60, |
| 134 | "Code": u.GenerateEmailActivateCode(email), |
| 135 | "Email": email, |
| 136 | } |
| 137 | body, err := render(tmplAuthActivateEmail, data) |
| 138 | if err != nil { |
| 139 | log.Error("HTMLString: %v", err) |
| 140 | return |
| 141 | } |
| 142 | |
| 143 | msg := NewMessage([]string{email}, c.Tr("mail.activate_email"), body) |
| 144 | msg.Info = fmt.Sprintf("UID: %d, activate email", u.ID()) |
| 145 | |
| 146 | Send(msg) |
| 147 | } |
| 148 | |
| 149 | // SendRegisterNotifyMail triggers a notify e-mail by admin created a account. |
| 150 | func SendRegisterNotifyMail(c *macaron.Context, u User) { |
no test coverage detected