diff options
author | zeripath <art27@cantab.net> | 2022-03-19 12:45:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 20:45:44 +0800 |
commit | fb08d2b3fd04dc8fc6cbd45fd341773b817c0857 (patch) | |
tree | 5f8c5da22ab64e5421fe5ca5075ab8fe8eca9355 /services/mailer/mail_repo.go | |
parent | 60fbaa90683add2a8af891fc2ca8448b9b75c92e (diff) | |
download | gitea-fb08d2b3fd04dc8fc6cbd45fd341773b817c0857.tar.gz gitea-fb08d2b3fd04dc8fc6cbd45fd341773b817c0857.zip |
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 <art27@cantab.net>
Diffstat (limited to 'services/mailer/mail_repo.go')
-rw-r--r-- | services/mailer/mail_repo.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/mailer/mail_repo.go b/services/mailer/mail_repo.go index a5343f8128..24e6d671f4 100644 --- a/services/mailer/mail_repo.go +++ b/services/mailer/mail_repo.go @@ -31,6 +31,10 @@ func SendRepoTransferNotifyMail(doer, newOwner *user_model.User, repo *repo_mode langMap := make(map[string][]string) for _, user := range users { + if !user.IsActive { + // don't send emails to inactive users + continue + } langMap[user.Language] = append(langMap[user.Language], user.Email) } |