// SendRegisterNotifyMail triggers a notify e-mail by admin created a account. func SendRegisterNotifyMail(c *macaron.Context, u *models.User) { body, err := c.HTMLString(string(AUTH_REGISTER_NOTIFY), ComposeTplData(u)) if err != nil { log.Error(4, "HTMLString: %v", err) return } msg := NewMessage([]string{u.Email}, c.Tr("mail.register_notify"), body) msg.Info = fmt.Sprintf("UID: %d, registration notify", u.Id) SendAsync(msg) }
func SendUserMail(c *macaron.Context, u *models.User, tpl base.TplName, code, subject, info string) { data := ComposeTplData(u) data["Code"] = code body, err := c.HTMLString(string(tpl), data) if err != nil { log.Error(4, "HTMLString: %v", err) return } msg := NewMessage([]string{u.Email}, subject, body) msg.Info = fmt.Sprintf("UID: %d, %s", u.Id, info) SendAsync(msg) }
// SendActivateAccountMail sends confirmation e-mail. func SendActivateEmailMail(c *macaron.Context, u *models.User, email *models.EmailAddress) { data := ComposeTplData(u) data["Code"] = u.GenerateEmailActivateCode(email.Email) data["Email"] = email.Email body, err := c.HTMLString(string(AUTH_ACTIVATE_EMAIL), data) if err != nil { log.Error(4, "HTMLString: %v", err) return } msg := NewMessage([]string{email.Email}, c.Tr("mail.activate_email"), body) msg.Info = fmt.Sprintf("UID: %d, activate email", u.Id) SendAsync(msg) }