diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-11-09 22:32:04 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-11-09 22:32:04 +0300 |
commit | 36f255b24a03f535121b57f0727ebeaf439a8189 (patch) | |
tree | b82789df112fe17a58569282b6afec9537f83249 /app/mailers | |
parent | add80eb932d4e16ad7748b9ef68e9b43984e430f (diff) | |
parent | 66cddf34d3e554350acfe64aa1905334e977b259 (diff) |
Merge remote-tracking branch 'ce/master' into ce-to-ee
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/pipelines.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb index 601c8b5cd62..9460a6cd2be 100644 --- a/app/mailers/emails/pipelines.rb +++ b/app/mailers/emails/pipelines.rb @@ -1,22 +1,27 @@ module Emails module Pipelines - def pipeline_success_email(pipeline, to) - pipeline_mail(pipeline, to, 'succeeded') + def pipeline_success_email(pipeline, recipients) + pipeline_mail(pipeline, recipients, 'succeeded') end - def pipeline_failed_email(pipeline, to) - pipeline_mail(pipeline, to, 'failed') + def pipeline_failed_email(pipeline, recipients) + pipeline_mail(pipeline, recipients, 'failed') end private - def pipeline_mail(pipeline, to, status) + def pipeline_mail(pipeline, recipients, status) @project = pipeline.project @pipeline = pipeline @merge_request = pipeline.merge_requests.first add_headers - mail(to: to, subject: pipeline_subject(status), skip_premailer: true) do |format| + # We use bcc here because we don't want to generate this emails for a + # thousand times. This could be potentially expensive in a loop, and + # recipients would contain all project watchers so it could be a lot. + mail(bcc: recipients, + subject: pipeline_subject(status), + skip_premailer: true) do |format| format.html { render layout: false } format.text end |