diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-19 10:46:48 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-19 10:46:48 -0400 |
commit | ddbd2ce152a7443076e3000fc1723f4589611ca8 (patch) | |
tree | 2fa8bca12ce6f44b928fa81d7a88acc4bf7655fb /routers/user/user.go | |
parent | 3634d1ee326fd285935c0a5992575583ef6467d4 (diff) |
Add register mail tpl
Diffstat (limited to 'routers/user/user.go')
-rw-r--r-- | routers/user/user.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index 42030076..52b75f66 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -14,6 +14,7 @@ import ( "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" + "github.com/gogits/gogs/modules/mailer" "github.com/gogits/gogs/modules/middleware" ) @@ -152,7 +153,12 @@ func SignUp(ctx *middleware.Context, form auth.RegisterForm) { // Send confirmation e-mail. if base.Service.RegisterEmailConfirm { - auth.SendRegisterMail(u) + mailer.SendRegisterMail(ctx.Render, u) + ctx.Data["IsSendRegisterMail"] = true + ctx.Data["Email"] = u.Email + ctx.Data["Hours"] = base.Service.ActiveCodeLives / 60 + ctx.Render.HTML(200, "user/active", ctx.Data) + return } ctx.Redirect("/user/login") } @@ -228,7 +234,8 @@ func Activate(ctx *middleware.Context) { ctx.Data["IsActivatePage"] = true // Resend confirmation e-mail. if base.Service.RegisterEmailConfirm { - auth.SendRegisterMail(ctx.User) + ctx.Data["Hours"] = base.Service.ActiveCodeLives / 60 + mailer.SendActiveMail(ctx.Render, ctx.User) } else { ctx.Data["ServiceNotEnabled"] = true } |