Commit 1208c6ca authored by Marin Jankovski's avatar Marin Jankovski

Notification for reopened issue.

parent 8d106bed
...@@ -4,6 +4,7 @@ module Issues ...@@ -4,6 +4,7 @@ module Issues
if issue.reopen if issue.reopen
event_service.reopen_issue(issue, current_user) event_service.reopen_issue(issue, current_user)
create_note(issue) create_note(issue)
notification_service.reopen_issue(issue, current_user)
execute_hooks(issue, 'reopen') execute_hooks(issue, 'reopen')
end end
......
...@@ -80,6 +80,10 @@ class NotificationService ...@@ -80,6 +80,10 @@ class NotificationService
close_resource_email(merge_request, merge_request.target_project, current_user, 'closed_merge_request_email') close_resource_email(merge_request, merge_request.target_project, current_user, 'closed_merge_request_email')
end end
def reopen_issue(issue, current_user)
reopen_resource_email(issue, issue.project, current_user, 'issue_status_changed_email', 'reopened')
end
# When we merge a merge request we should send next emails: # When we merge a merge request we should send next emails:
# #
# * merge_request author if their notification level is not Disabled # * merge_request author if their notification level is not Disabled
...@@ -319,6 +323,16 @@ class NotificationService ...@@ -319,6 +323,16 @@ class NotificationService
end end
end end
def reopen_resource_email(target, project, current_user, method, status)
recipients = reject_muted_users([target.author, target.assignee], project)
recipients = recipients.concat(project_watchers(project)).uniq
recipients.delete(current_user)
recipients.each do |recipient|
mailer.send(method, recipient.id, target.id, status, current_user.id)
end
end
def mailer def mailer
Notify.delay Notify.delay
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment