From 5ce7905a332e271ce79d63ea42363552a5af83ed Mon Sep 17 00:00:00 2001 From: drummer83 Date: Sun, 31 Dec 2023 02:25:31 +0100 Subject: [PATCH] White labelling ALL customer facing emails White labelling added for Order: cancellation email, Order: invoice email, Shipment: shipped email, Subscriptions: authorize payment email, Subscriptions: placement email, Subscriptions: empty order email, Subscriptions: failed payment email White labelling existed already for Order: confirmation email, Subscriptions: order confirmation email --- app/mailers/payment_mailer.rb | 1 + app/mailers/spree/order_mailer.rb | 2 ++ app/mailers/spree/shipment_mailer.rb | 1 + app/mailers/subscription_mailer.rb | 3 +++ 4 files changed, 7 insertions(+) diff --git a/app/mailers/payment_mailer.rb b/app/mailers/payment_mailer.rb index f9819d252a..175e1da042 100644 --- a/app/mailers/payment_mailer.rb +++ b/app/mailers/payment_mailer.rb @@ -6,6 +6,7 @@ class PaymentMailer < ApplicationMailer def authorize_payment(payment) @payment = payment @order = @payment.order + @hide_ofn_navigation = @payment.order.distributor.hide_ofn_navigation subject = I18n.t('spree.payment_mailer.authorize_payment.subject', distributor: @order.distributor.name) I18n.with_locale valid_locale(@order.user) do diff --git a/app/mailers/spree/order_mailer.rb b/app/mailers/spree/order_mailer.rb index b396e79283..7ee64eab8a 100644 --- a/app/mailers/spree/order_mailer.rb +++ b/app/mailers/spree/order_mailer.rb @@ -11,6 +11,7 @@ module Spree def cancel_email(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 mail(to: @order.email, subject: mail_subject(t('spree.order_mailer.cancel_email.subject'), resend), @@ -51,6 +52,7 @@ module Spree def invoice_email(order_or_order_id, options = {}) @order = find_order(order_or_order_id) + @hide_ofn_navigation = @order.distributor.hide_ofn_navigation current_user = if options[:current_user_id].present? find_user(options[:current_user_id]) end diff --git a/app/mailers/spree/shipment_mailer.rb b/app/mailers/spree/shipment_mailer.rb index 7b9216335b..5955220d8d 100644 --- a/app/mailers/spree/shipment_mailer.rb +++ b/app/mailers/spree/shipment_mailer.rb @@ -4,6 +4,7 @@ module Spree class ShipmentMailer < ApplicationMailer def shipped_email(shipment, delivery:) @shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment) + @hide_ofn_navigation = @shipment.order.distributor.hide_ofn_navigation @delivery = delivery @order = @shipment.order subject = base_subject diff --git a/app/mailers/subscription_mailer.rb b/app/mailers/subscription_mailer.rb index b9aee15045..08b0031de4 100644 --- a/app/mailers/subscription_mailer.rb +++ b/app/mailers/subscription_mailer.rb @@ -19,6 +19,7 @@ class SubscriptionMailer < ApplicationMailer @type = 'empty' @changes = changes @order = order + @hide_ofn_navigation = @order.distributor.hide_ofn_navigation send_mail(order) end @@ -26,11 +27,13 @@ class SubscriptionMailer < ApplicationMailer @type = 'placement' @changes = changes @order = order + @hide_ofn_navigation = @order.distributor.hide_ofn_navigation send_mail(order) end def failed_payment_email(order) @order = order + @hide_ofn_navigation = @order.distributor.hide_ofn_navigation send_mail(order) end