Do not display OFN banner on order confirmation email if white label

This commit is contained in:
Jean-Baptiste Bellet
2023-05-17 11:28:33 +02:00
parent dfafbfe996
commit 2336981ca0
2 changed files with 15 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ module Spree
def confirm_email_for_customer(order_or_order_id, resend = false)
@order = find_order(order_or_order_id)
@hide_ofn_navigation = @order.distributor.hide_ofn_navigation
I18n.with_locale valid_locale(@order.user) do
subject = mail_subject(t('spree.order_mailer.confirm_email.subject'), resend)
mail(to: @order.email,

View File

@@ -44,6 +44,20 @@ describe Spree::OrderMailer do
described_class.confirm_email_for_customer(order.id).deliver_now
}.to_not raise_error
end
it "display the OFN header by default" do
expect(email.body).to include(ContentConfig.url_for(:footer_logo))
end
context 'when hide OFN navigation is enabled for the distributor of the order' do
before do
allow(order.distributor).to receive(:hide_ofn_navigation).and_return(true)
end
it 'does not display the OFN navigation' do
expect(email.body).to_not include(ContentConfig.url_for(:footer_logo))
end
end
end
describe '#confirm_email_for_shop' do