diff --git a/core/lib/spree/core/engine.rb b/core/lib/spree/core/engine.rb index b90d4f9f924..98f47e83d9d 100644 --- a/core/lib/spree/core/engine.rb +++ b/core/lib/spree/core/engine.rb @@ -80,10 +80,10 @@ class Engine < ::Rails::Engine end end - initializer "spree.core.action_mailer.set_preview_path", before: "action_mailer.set_autoload_paths" do |app| + initializer "spree.core.action_mailer.set_preview_path", after: "action_mailer.set_autoload_paths" do |app| if Rails.gem_version >= Gem::Version.new('7.1.0') - solidus_preview_path = Spree::Core::Engine.root.join 'lib/spree/mailer_previews' - app.config.action_mailer.preview_paths << solidus_preview_path.to_s + solidus_preview_path = Spree::Core::Engine.root.join('lib/spree/mailer_previews') + ActionMailer::Base.preview_paths << solidus_preview_path.to_s end end