reject current_user from close issue emails
This commit is contained in:
parent
4b3950456d
commit
bfebf10850
1 changed files with 10 additions and 2 deletions
|
@ -21,7 +21,12 @@ class NotificationService
|
||||||
# * project team members with notification level higher then Participating
|
# * project team members with notification level higher then Participating
|
||||||
#
|
#
|
||||||
def close_issue(issue, current_user)
|
def close_issue(issue, current_user)
|
||||||
[issue.author, issue.assignee].compact.uniq.each do |recipient|
|
recipients = [issue.author, issue.assignee].compact.uniq
|
||||||
|
|
||||||
|
# Dont send email to me when I close an issue
|
||||||
|
recipients.reject! { |u| u == current_user }
|
||||||
|
|
||||||
|
recipients.each do |recipient|
|
||||||
Notify.delay.issue_status_changed_email(recipient.id, issue.id, issue.state, current_user.id)
|
Notify.delay.issue_status_changed_email(recipient.id, issue.id, issue.state, current_user.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -32,7 +37,10 @@ class NotificationService
|
||||||
# * issue assignee if his notification level is not Disabled
|
# * issue assignee if his notification level is not Disabled
|
||||||
#
|
#
|
||||||
def reassigned_issue(issue, current_user)
|
def reassigned_issue(issue, current_user)
|
||||||
recipient_ids = [issue.assignee_id, issue.assignee_id_was].keep_if {|id| id && id != current_user.id }
|
recipient_ids = [issue.assignee_id, issue.assignee_id_was].compact.uniq
|
||||||
|
|
||||||
|
# Reject me from recipients if I reassign an issue
|
||||||
|
recipient_ids.reject! { |id| id == current_user.id }
|
||||||
|
|
||||||
recipient_ids.each do |recipient_id|
|
recipient_ids.each do |recipient_id|
|
||||||
Notify.delay.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was)
|
Notify.delay.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was)
|
||||||
|
|
Loading…
Add table
Reference in a new issue