Files
openfoodnetwork/spec/mailers/previews/shipment_preview.rb
Maikel Linke 6c8e383ab8 Fix ShipmentMailer preview autoload path
The Zeitwerk autoloader requires class names and file names to match. In
this case, the class had a Spree namespace without being in a spree
folder. The preview couldn't be displayed. Now it can be displayed.
2023-04-17 15:18:22 +10:00

13 lines
320 B
Ruby

# frozen_string_literal: true
require 'open_food_network/scope_variant_to_hub'
class ShipmentPreview < ActionMailer::Preview
def shipped
shipment =
Spree::Shipment.where.not(tracking: [nil, ""]).last ||
Spree::Shipment.last
Spree::ShipmentMailer.shipped_email(shipment, delivery: true)
end
end