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.
This commit is contained in:
Matt-Yorkley
2021-06-17 09:35:25 +01:00
parent 6ebc6bcd6f
commit bb848811e6

View File

@@ -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