mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-18 00:56:41 +10:00
Notification for reopened issue.
This commit is contained in:
@@ -4,6 +4,7 @@ module Issues
|
||||
if issue.reopen
|
||||
event_service.reopen_issue(issue, current_user)
|
||||
create_note(issue)
|
||||
notification_service.reopen_issue(issue, current_user)
|
||||
execute_hooks(issue, 'reopen')
|
||||
end
|
||||
|
||||
|
||||
@@ -80,6 +80,10 @@ class NotificationService
|
||||
close_resource_email(merge_request, merge_request.target_project, current_user, 'closed_merge_request_email')
|
||||
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:
|
||||
#
|
||||
# * merge_request author if their notification level is not Disabled
|
||||
@@ -319,6 +323,16 @@ class NotificationService
|
||||
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
|
||||
Notify.delay
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user