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

- (Object) shipped



4
5
6
7
8
# File 'lib/spree/mailer_previews/carton_preview.rb', line 4

def shipped
  carton = Carton.joins(:orders).last
  raise "Your database needs at 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: carton)
end