Class: ShipmentMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/shipment_mailer.rb

Instance Method Summary collapse

Instance Method Details

#shipped_email(shipment, resend = false) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/mailers/shipment_mailer.rb', line 4

def shipped_email(shipment, resend=false)
  @shipment = shipment
  subject = (resend ? "[RESEND] " : "")
  subject += "#{Spree::Config[:site_name]} Shipment Notification ##{shipment.order.number}"
  mail_params = {:to => shipment.order.email, :subject => subject}
  mail_params[:from] = shipment.order.store.email if shipment.order.store.email.present?
  mail(mail_params)
end