mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
Order confirmation emails are not sent for standing order orders.
This commit is contained in:
@@ -293,7 +293,9 @@ Spree::Order.class_eval do
|
||||
# Overrride of Spree method, that allows us to send separate confirmation emails to user and shop owners
|
||||
# And separately, to skip sending confirmation email completely for user invoice orders
|
||||
def deliver_order_confirmation_email
|
||||
Delayed::Job.enqueue ConfirmOrderJob.new(id) unless account_invoice?
|
||||
unless account_invoice? || standing_order.present?
|
||||
Delayed::Job.enqueue ConfirmOrderJob.new(id)
|
||||
end
|
||||
end
|
||||
|
||||
def changes_allowed?
|
||||
|
||||
@@ -572,6 +572,14 @@ describe Spree::Order do
|
||||
order.deliver_order_confirmation_email
|
||||
end.to_not enqueue_job ConfirmOrderJob
|
||||
end
|
||||
|
||||
it "does not send confirmation emails when the order belongs to a standing order" do
|
||||
create(:standing_order_with_items, orders: [order])
|
||||
|
||||
expect do
|
||||
order.deliver_order_confirmation_email
|
||||
end.to_not enqueue_job ConfirmOrderJob
|
||||
end
|
||||
end
|
||||
|
||||
describe "associating a customer" do
|
||||
|
||||
Reference in New Issue
Block a user