summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-17 01:54:12 -0400
committerUnknwon <u@gogs.io>2015-09-17 01:54:12 -0400
commit373731f5e85566eb385e92f604e81232e3d6ba1a (patch)
tree83311e464adf24f3006030e27473086e43a11240 /routers
parente75fd2f783a413ae612e3e6110c912b3ecf9555d (diff)
downloadgitea-373731f5e85566eb385e92f604e81232e3d6ba1a.tar.gz
gitea-373731f5e85566eb385e92f604e81232e3d6ba1a.zip
user gomail and new activate account email tpl
- #1496: fallback plain text - #1002: add date header - #913: fix encoding of header
Diffstat (limited to 'routers')
-rw-r--r--routers/dev/template.go1
-rw-r--r--routers/install.go2
-rw-r--r--routers/user/auth.go4
-rw-r--r--routers/user/setting.go2
4 files changed, 5 insertions, 4 deletions
diff --git a/routers/dev/template.go b/routers/dev/template.go
index 9528c74c64..5548f51478 100644
--- a/routers/dev/template.go
+++ b/routers/dev/template.go
@@ -20,5 +20,6 @@ func TemplatePreview(ctx *middleware.Context) {
ctx.Data["ActiveCodeLives"] = setting.Service.ActiveCodeLives / 60
ctx.Data["ResetPwdCodeLives"] = setting.Service.ResetPwdCodeLives / 60
ctx.Data["CurDbValue"] = ""
+
ctx.HTML(200, base.TplName(ctx.Params("*")))
}
diff --git a/routers/install.go b/routers/install.go
index f4df031186..c5d7972153 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -45,6 +45,7 @@ func checkRunMode() {
func NewServices() {
setting.NewServices()
+ mailer.NewContext()
social.NewOauthService()
}
@@ -53,7 +54,6 @@ func GlobalInit() {
setting.NewContext()
log.Trace("Custom path: %s", setting.CustomPath)
log.Trace("Log path: %s", setting.LogRootPath)
- mailer.NewContext()
models.LoadConfigs()
NewServices()
diff --git a/routers/user/auth.go b/routers/user/auth.go
index 6694e7e8f3..fa48612737 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -249,7 +249,7 @@ func SignUpPost(ctx *middleware.Context, cpt *captcha.Captcha, form auth.Registe
// Send confirmation e-mail, no need for social account.
if !isOauth && setting.Service.RegisterEmailConfirm && u.Id > 1 {
- mailer.SendRegisterMail(ctx.Render, u)
+ mailer.SendActivateAccountMail(ctx.Context, u)
ctx.Data["IsSendRegisterMail"] = true
ctx.Data["Email"] = u.Email
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
@@ -278,7 +278,7 @@ func Activate(ctx *middleware.Context) {
ctx.Data["ResendLimited"] = true
} else {
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
- mailer.SendActiveMail(ctx.Render, ctx.User)
+ mailer.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)
diff --git a/routers/user/setting.go b/routers/user/setting.go
index a7a52093bc..158e2e3096 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -225,7 +225,7 @@ func SettingsEmailPost(ctx *middleware.Context, form auth.AddEmailForm) {
// Send confirmation e-mail
if setting.Service.RegisterEmailConfirm {
- mailer.SendActivateEmail(ctx.Render, ctx.User, e)
+ mailer.SendActivateEmailMail(ctx.Context, ctx.User, e)
if err := ctx.Cache.Put("MailResendLimit_"+ctx.User.LowerName, ctx.User.LowerName, 180); err != nil {
log.Error(4, "Set cache(MailResendLimit) fail: %v", err)