From 1cdad622aacf9ae7e7d61e575aaa77dddf7ae7b9 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Thu, 20 Oct 2016 18:13:45 +0800
Subject: [PATCH] Should send to notification_email instead, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_17146325
---
 app/services/notification_service.rb                        | 2 +-
 spec/models/project_services/pipeline_email_service_spec.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index d5d69248af7..2cc9a9fd7bf 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -321,7 +321,7 @@ class NotificationService
       pipeline,
       pipeline.project,
       nil, # The acting user, who won't be added to recipients
-      action: pipeline.status).map(&:email)
+      action: pipeline.status).map(&:notification_email)
 
     mailer.public_send(email_template, pipeline, recipients).deliver_later
   end
diff --git a/spec/models/project_services/pipeline_email_service_spec.rb b/spec/models/project_services/pipeline_email_service_spec.rb
index 57baff3354f..4f56bceda44 100644
--- a/spec/models/project_services/pipeline_email_service_spec.rb
+++ b/spec/models/project_services/pipeline_email_service_spec.rb
@@ -58,7 +58,7 @@ describe PipelinesEmailService do
     end
 
     it 'sends email' do
-      should_only_email(double(email: recipient), kind: :bcc)
+      should_only_email(double(notification_email: recipient), kind: :bcc)
     end
   end
 
-- 
GitLab