From 7fc5fd6415f92120811747681bcde9ed42825151 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 18 Mar 2022 09:57:07 +0000 Subject: Do not send activation email if manual confirm is set (#19119) If the mailer is configured then even if Manual confirm is set an activation email is still being sent because `handleUserCreated` is not checking for this case. Fix #17263 Signed-off-by: Andrew Thornton Co-authored-by: Lunny Xiao --- routers/web/auth/auth.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'routers/web/auth/auth.go') diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 64196e28cd..f20af80c1e 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -621,6 +621,12 @@ func handleUserCreated(ctx *context.Context, u *user_model.User, gothUser *goth. // Send confirmation email if !u.IsActive && u.ID > 1 { + if setting.Service.RegisterManualConfirm { + ctx.Data["ManualActivationOnly"] = true + ctx.HTML(http.StatusOK, TplActivate) + return + } + mailer.SendActivateAccountMail(ctx.Locale, u) ctx.Data["IsSendRegisterMail"] = true -- cgit v1.2.3