Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-26 21:09:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-26 21:09:19 +0300
commit67049ac7aa4accb5a964975291ce5890e65c3110 (patch)
treedf8e1d34e5facf7892afed250de4bb2b9dbcd689 /app/workers/emails_on_push_worker.rb
parent5169b4a63b1e592e159b5451f81bc3c11602275f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/emails_on_push_worker.rb')
-rw-r--r--app/workers/emails_on_push_worker.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb
index 0230a226567..d7bd8207f06 100644
--- a/app/workers/emails_on_push_worker.rb
+++ b/app/workers/emails_on_push_worker.rb
@@ -87,13 +87,14 @@ class EmailsOnPushWorker # rubocop:disable Scalability/IdempotentWorker
private
def send_email(recipient, project_id, options)
- # Generating the body of this email can be expensive, so only do it once
- @skip_premailer ||= email.present?
- @email ||= Notify.repository_push_email(project_id, options)
-
- email.to = recipient
- email.add_message_id
- email.header[:skip_premailer] = true if skip_premailer
- email.deliver_now
+ @email ||= Notify.repository_push_email(project_id, options).tap do |mail|
+ Premailer::Rails::Hook.perform(mail)
+ end
+
+ current_email = email.dup
+ current_email.to = recipient
+ current_email.add_message_id
+ current_email.header[:skip_premailer] = true
+ current_email.deliver_now
end
end