Skip to content

Commit 3322f4d

Browse files
authored
not send notification emails to inactive users (part 2) (#19142)
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 <[email protected]>
1 parent 2d21d2a commit 3322f4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

services/mailer/mail_issue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ func mailIssueCommentBatch(ctx *mailCommentContext, users []*user_model.User, vi
126126

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

0 commit comments

Comments
 (0)