summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-16 00:36:39 +0800
committerUnknwon <u@gogs.io>2016-07-16 00:36:39 +0800
commitf1b8d52eb3ac230ed5a275f4a844ddb0cf48041e (patch)
tree51dda05a9fb7a985a4e91f3e1708ffddf3fee19c /routers/user
parent7ca5f8f119593023809e6130db75154597c52426 (diff)
downloadgitea-f1b8d52eb3ac230ed5a275f4a844ddb0cf48041e.tar.gz
gitea-f1b8d52eb3ac230ed5a275f4a844ddb0cf48041e.zip
#2854 fix no mail notification when issue is closed/reopened
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/auth.go11
-rw-r--r--routers/user/setting.go13
2 files changed, 11 insertions, 13 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index 9b48357aaa..df79ecbe4c 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -15,7 +15,6 @@ import (
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
- "github.com/gogits/gogs/modules/mailer"
"github.com/gogits/gogs/modules/setting"
)
@@ -220,9 +219,9 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
}
}
- // Send confirmation e-mail, no need for social account.
+ // Send confirmation email, no need for social account.
if setting.Service.RegisterEmailConfirm && u.Id > 1 {
- mailer.SendActivateAccountMail(ctx.Context, u)
+ models.SendActivateAccountMail(ctx.Context, u)
ctx.Data["IsSendRegisterMail"] = true
ctx.Data["Email"] = u.Email
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
@@ -245,13 +244,13 @@ func Activate(ctx *context.Context) {
ctx.Error(404)
return
}
- // Resend confirmation e-mail.
+ // Resend confirmation email.
if setting.Service.RegisterEmailConfirm {
if ctx.Cache.IsExist("MailResendLimit_" + ctx.User.LowerName) {
ctx.Data["ResendLimited"] = true
} else {
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
- mailer.SendActivateAccountMail(ctx.Context, ctx.User)
+ models.SendActivateAccountMail(ctx.Context, ctx.User)
if err := ctx.Cache.Put("MailResendLimit_"+ctx.User.LowerName, ctx.User.LowerName, 180); err != nil {
log.Error(4, "Set cache(MailResendLimit) fail: %v", err)
@@ -355,7 +354,7 @@ func ForgotPasswdPost(ctx *context.Context) {
return
}
- mailer.SendResetPasswordMail(ctx.Context, u)
+ models.SendResetPasswordMail(ctx.Context, u)
if err = ctx.Cache.Put("MailResendLimit_"+u.LowerName, u.LowerName, 180); err != nil {
log.Error(4, "Set cache(MailResendLimit) fail: %v", err)
}
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 4b62bb11cc..c910cd4e14 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -17,7 +17,6 @@ import (
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
- "github.com/gogits/gogs/modules/mailer"
"github.com/gogits/gogs/modules/setting"
)
@@ -239,12 +238,12 @@ func SettingsEmailPost(ctx *context.Context, form auth.AddEmailForm) {
return
}
- e := &models.EmailAddress{
+ email := &models.EmailAddress{
UID: ctx.User.Id,
Email: form.Email,
IsActivated: !setting.Service.RegisterEmailConfirm,
}
- if err := models.AddEmailAddress(e); err != nil {
+ if err := models.AddEmailAddress(email); err != nil {
if models.IsErrEmailAlreadyUsed(err) {
ctx.RenderWithErr(ctx.Tr("form.email_been_used"), SETTINGS_EMAILS, &form)
return
@@ -253,19 +252,19 @@ func SettingsEmailPost(ctx *context.Context, form auth.AddEmailForm) {
return
}
- // Send confirmation e-mail
+ // Send confirmation email
if setting.Service.RegisterEmailConfirm {
- mailer.SendActivateEmailMail(ctx.Context, ctx.User, e)
+ models.SendActivateEmailMail(ctx.Context, ctx.User, email)
if err := ctx.Cache.Put("MailResendLimit_"+ctx.User.LowerName, ctx.User.LowerName, 180); err != nil {
log.Error(4, "Set cache(MailResendLimit) fail: %v", err)
}
- ctx.Flash.Info(ctx.Tr("settings.add_email_confirmation_sent", e.Email, setting.Service.ActiveCodeLives/60))
+ ctx.Flash.Info(ctx.Tr("settings.add_email_confirmation_sent", email.Email, setting.Service.ActiveCodeLives/60))
} else {
ctx.Flash.Success(ctx.Tr("settings.add_email_success"))
}
- log.Trace("Email address added: %s", e.Email)
+ log.Trace("Email address added: %s", email.Email)
ctx.Redirect(setting.AppSubUrl + "/user/settings/email")
}