Class: Spree::CartonMailer
- Inherits:
-
BaseMailer
- Object
- ActionMailer::Base
- BaseMailer
- Spree::CartonMailer
- Defined in:
- app/mailers/spree/carton_mailer.rb
Instance Method Summary collapse
-
#shipped_email(options, deprecated_options = {}) ⇒ Mail::Message
Send an email to customers to notify that an individual carton has been shipped.
Methods inherited from BaseMailer
Instance Method Details
#shipped_email(options, deprecated_options = {}) ⇒ Mail::Message
Send an email to customers to notify that an individual carton has been shipped. If a carton contains items from multiple orders then this will be called with that carton one time for each order.
Note: The signature of this method has changed. The new (non-deprecated) signature is:
def shipped_email(carton:, order:, resend: false)
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/mailers/spree/carton_mailer.rb', line 16 def shipped_email(, ={}) if .is_a?(Integer) ActiveSupport::Deprecation.warn "Calling shipped_email with a carton_id is DEPRECATED. Instead use CartonMailer.shipped_email(order: order, carton: carton)" @carton = Carton.find() @order = @carton.orders.first # assume first order @manifest = @carton.manifest # use the entire manifest, since we don't know the precise order = else @order = .fetch(:order) @carton = .fetch(:carton) @manifest = @carton.manifest_for_order(@order) end = {resend: false}.merge() @store = @order.store subject = ([:resend] ? "[#{Spree.t(:resend).upcase}] " : '') subject += "#{@store.name} #{Spree.t('shipment_mailer.shipped_email.subject')} ##{@order.number}" mail(to: @order.email, from: from_address(@store), subject: subject) end |