diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-26 21:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-26 21:09:19 +0300 |
commit | 67049ac7aa4accb5a964975291ce5890e65c3110 (patch) | |
tree | df8e1d34e5facf7892afed250de4bb2b9dbcd689 /app/workers | |
parent | 5169b4a63b1e592e159b5451f81bc3c11602275f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/emails_on_push_worker.rb | 17 |
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 |