From 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Nov 2021 13:16:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-5-stable-ee --- app/workers/emails_on_push_worker.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'app/workers/emails_on_push_worker.rb') 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 -- cgit v1.2.1