diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-09-14 14:42:16 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-10-17 10:24:48 +0300 |
commit | 8ea702cfe590e94ea496609f85ba0f23bda2dcce (patch) | |
tree | b5aef28ad58ae357b0cdce8651f76710fb69439f /app/services/notification_service.rb | |
parent | 7f7c3e1a8aeba5d21c332c8cacdf8af9067199c4 (diff) |
Revert "Split notification integration into another branch"
This reverts commit 1404aa8677969a03ed56e8f8350257f317f576d8.
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 72712afc07e..65091c2b8af 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -312,6 +312,22 @@ class NotificationService mailer.project_was_not_exported_email(current_user, project, errors).deliver_later end + def pipeline_finished(pipeline, recipients = nil) + email_template = "pipeline_#{pipeline.status}_email" + + return unless mailer.respond_to?(email_template) + + recipients ||= build_recipients( + pipeline, + pipeline.project, + nil, # The acting user, who won't be added to recipients + action: pipeline.status) + + recipients.each do |to| + mailer.public_send(email_template, pipeline, to.email).deliver_later + end + end + protected # Get project/group users with CUSTOM notification level |