Class: Spree::MailerPreviews::CartonPreview

Inherits:
ActionMailer::Preview
  • Object
show all
Defined in:
lib/spree/mailer_previews/carton_preview.rb

Instance Method Summary collapse

Instance Method Details

#shippedObject



6
7
8
9
10
11
# File 'lib/spree/mailer_previews/carton_preview.rb', line 6

def shipped
  carton = Carton.joins(:orders).last
  raise "Your database needs at least one shipped order with a carton to render this preview" unless carton

  Spree::Config.carton_shipped_email_class.shipped_email(order: carton.orders.first, carton:)
end