From fb08d2b3fd04dc8fc6cbd45fd341773b817c0857 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 19 Mar 2022 12:45:44 +0000 Subject: Do not send notification emails to inactive users (#19131) Emails should not be sent to inactive users except for Activate and ResetPassword messages. Fix #18950 Signed-off-by: Andrew Thornton --- routers/private/mail.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/private') diff --git a/routers/private/mail.go b/routers/private/mail.go index 8b69c38093..853b58b09d 100644 --- a/routers/private/mail.go +++ b/routers/private/mail.go @@ -60,7 +60,7 @@ func SendEmail(ctx *context.PrivateContext) { } } else { err := user_model.IterateUser(func(user *user_model.User) error { - if len(user.Email) > 0 { + if len(user.Email) > 0 && user.IsActive { emails = append(emails, user.Email) } return nil -- cgit v1.2.3