Skip to content

Commit

Permalink
not send notification emails to inactive users (part 2) (#19142)
Browse files Browse the repository at this point in the history
Unfortunately fixing changes to `mail_issue.go` did not get included in #19131.

We also need to not send issue comment mails to deactivated users.

Fix #18950

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Mar 19, 2022
1 parent 2d21d2a commit 3322f4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/mailer/mail_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ func mailIssueCommentBatch(ctx *mailCommentContext, users []*user_model.User, vi

langMap := make(map[string][]*user_model.User)
for _, user := range users {
if !user.IsActive {
// Exclude deactivated users
continue
}
// At this point we exclude:
// user that don't have all mails enabled or users only get mail on mention and this is one ...
if !(user.EmailNotificationsPreference == user_model.EmailNotificationsEnabled ||
Expand Down

0 comments on commit 3322f4d

Please sign in to comment.