Class: Spree::ShipmentMailer

Inherits:
BaseMailer
  • Object
show all
Defined in:
app/mailers/spree/shipment_mailer.rb

Instance Method Summary collapse

Methods inherited from BaseMailer

#from_address, #frontend_available?, #mail, #money

Instance Method Details

#shipped_email(shipment, resend = false) ⇒ Object



3
4
5
6
7
8
# File 'app/mailers/spree/shipment_mailer.rb', line 3

def shipped_email(shipment, resend = false)
  @shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment)
  subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '')
  subject += "#{Spree::Store.current.name} #{Spree.t('shipment_mailer.shipped_email.subject')} ##{@shipment.order.number}"
  mail(to: @shipment.order.email, from: from_address, subject: subject)
end