diff options
author | lulalala <mark@goodlife.tw> | 2018-05-09 17:49:33 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-05-17 08:54:51 +0800 |
commit | dc174e9655267e89e1b7c63f8c9f4dac069069c7 (patch) | |
tree | 33cebe2481870434098f88f253090f2de91b873d /app/services/notification_service.rb | |
parent | 179a1ee7c669e758f8dc9fb5e9c8f2563012a6e1 (diff) | |
download | gitlab-ce-dc174e9655267e89e1b7c63f8c9f4dac069069c7.tar.gz |
Notify with email when merge request became unmergeable
Display MR unmergeable reasons
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 8b3ddab5e19..636cfbf5b45 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -149,6 +149,15 @@ class NotificationService end end + # When a merge request is found to be unmergeable, we should send an email to: + # + # * mr author + # * mr merge user if set + # + def merge_request_unmergeable(merge_request) + merge_request_unmergeable_email(merge_request) + end + # When merge request text is updated, we should send an email to: # # * newly mentioned project team members with notification level higher than Participating @@ -485,6 +494,14 @@ class NotificationService end end + def merge_request_unmergeable_email(merge_request) + recipients = NotificationRecipientService.build_merge_request_unmergeable_recipients(merge_request) + + recipients.each do |recipient| + mailer.merge_request_unmergeable_email(recipient.user.id, merge_request.id).deliver_later + end + end + def mailer Notify end |