From bb848811e667da2db86263a697eec30a12ca3575 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 17 Jun 2021 09:35:25 +0100 Subject: [PATCH] Add a delay on sending order confirmation emails There's a race condition here that means the order's address is not always present when the email is first sent, but it *is* present shortly after. The fix in this commit is a temporary solution. --- app/models/spree/order.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 8aa158f487..e0a0092bd5 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -343,8 +343,8 @@ module Spree def deliver_order_confirmation_email return if subscription.present? - Spree::OrderMailer.confirm_email_for_customer(id).deliver_later - Spree::OrderMailer.confirm_email_for_shop(id).deliver_later + Spree::OrderMailer.confirm_email_for_customer(id).deliver_later(wait: 10.seconds) + Spree::OrderMailer.confirm_email_for_shop(id).deliver_later(wait: 10.seconds) end # Helper methods for checkout steps