diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /app/mailers/emails/pipelines.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) | |
download | gitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'app/mailers/emails/pipelines.rb')
-rw-r--r-- | app/mailers/emails/pipelines.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb index 1b27d062391..5363ad63771 100644 --- a/app/mailers/emails/pipelines.rb +++ b/app/mailers/emails/pipelines.rb @@ -2,21 +2,23 @@ module Emails module Pipelines - def pipeline_success_email(pipeline, recipients) - pipeline_mail(pipeline, recipients, 'Successful') + def pipeline_success_email(pipeline, recipient) + pipeline_mail(pipeline, recipient, 'Successful') end - def pipeline_failed_email(pipeline, recipients) - pipeline_mail(pipeline, recipients, 'Failed') + def pipeline_failed_email(pipeline, recipient) + pipeline_mail(pipeline, recipient, 'Failed') end - def pipeline_fixed_email(pipeline, recipients) - pipeline_mail(pipeline, recipients, 'Fixed') + def pipeline_fixed_email(pipeline, recipient) + pipeline_mail(pipeline, recipient, 'Fixed') end private - def pipeline_mail(pipeline, recipients, status) + def pipeline_mail(pipeline, recipient, status) + raise ArgumentError if recipient.is_a?(Array) + @project = pipeline.project @pipeline = pipeline @@ -28,10 +30,7 @@ module Emails add_headers - # We use bcc here because we don't want to generate these 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, + mail(to: recipient, subject: subject(pipeline_subject(status))) do |format| format.html { render layout: 'mailer' } format.text { render layout: 'mailer' } |