diff options
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 9a7af5730d2..b99e4c21229 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -312,18 +312,12 @@ class NotificationService 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).map(&:notification_email) - - if recipients.any? - mailer.public_send(email_template, pipeline, recipients).deliver_later + Emails::Pipelines.prepare_email(mailer, pipeline) do + build_recipients( + pipeline, + pipeline.project, + nil, # The acting user, who won't be added to recipients + action: pipeline.status).map(&:notification_email) end end |