Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Move MailHelper from core to emails gem (#13668)

Damian Legawiec33b3e2ab5db8
diff --git a/spree/core/app/mailers/spree/base_mailer.rb b/spree/core/app/mailers/spree/base_mailer.rb
index f6b3ab32dd..58f9109890 100644
--- a/spree/core/app/mailers/spree/base_mailer.rb
+++ b/spree/core/app/mailers/spree/base_mailer.rb
@@ -1,7 +1,5 @@
module Spree
class BaseMailer < ActionMailer::Base
- helper Spree::MailHelper
-
def current_store
@current_store ||= @order&.store.presence || Spree::Store.current || Spree::Store.default
end
diff --git a/spree/core/app/helpers/spree/mail_helper.rb b/spree/emails/app/helpers/spree/mail_helper.rb
similarity index 100%
rename from spree/core/app/helpers/spree/mail_helper.rb
rename to spree/emails/app/helpers/spree/mail_helper.rb
diff --git a/spree/emails/app/mailers/spree/order_mailer.rb b/spree/emails/app/mailers/spree/order_mailer.rb
index 924100cc96..ee7c50e397 100644
--- a/spree/emails/app/mailers/spree/order_mailer.rb
+++ b/spree/emails/app/mailers/spree/order_mailer.rb
@@ -1,5 +1,7 @@
module Spree
class OrderMailer < BaseMailer
+ helper Spree::MailHelper
+
def confirm_email(order, resend = false)
@order = order.respond_to?(:id) ? order : Spree::Order.find(order)
current_store = @order.store
diff --git a/spree/emails/app/mailers/spree/reimbursement_mailer.rb b/spree/emails/app/mailers/spree/reimbursement_mailer.rb
index 7bd8b3ea93..6fe34c4c09 100644
--- a/spree/emails/app/mailers/spree/reimbursement_mailer.rb
+++ b/spree/emails/app/mailers/spree/reimbursement_mailer.rb
@@ -1,5 +1,7 @@
module Spree
class ReimbursementMailer < BaseMailer
+ helper Spree::MailHelper
+
def reimbursement_email(reimbursement, resend = false)
@reimbursement = reimbursement.respond_to?(:id) ? reimbursement : Spree::Reimbursement.find(reimbursement)
@order = @reimbursement.order
diff --git a/spree/emails/app/mailers/spree/shipment_mailer.rb b/spree/emails/app/mailers/spree/shipment_mailer.rb
index fc37de4cd4..797f4dfbd2 100644
--- a/spree/emails/app/mailers/spree/shipment_mailer.rb
+++ b/spree/emails/app/mailers/spree/shipment_mailer.rb
@@ -1,5 +1,6 @@
module Spree
class ShipmentMailer < BaseMailer
+ helper Spree::MailHelper
helper Spree::ShipmentHelper
def shipped_email(shipment, resend = false)