Sha256: 19f6011b3a74fff9f03ec434046746467c5adf77dbec6ac0b5d706b598d4b8e2

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 KB

Contents

module Spree
  class CartonMailer < BaseMailer
    # 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.
    #
    # @param carton [Spree::Carton] the shipped carton
    # @param order [Spree::Order] one of the orders with items in the carton
    # @param resend [Boolean] indicates whether the email is a 'resend' (e.g.
    #        triggered by the admin "resend" button)
    # @return [Mail::Message]
    #
    # Note: The signature of this method has changed. The new (non-deprecated)
    # signature is:
    #   def shipped_email(carton:, order:, resend: false)
    def shipped_email(options, deprecated_options = {})
      @order = options.fetch(:order)
      @carton = options.fetch(:carton)
      @manifest = @carton.manifest_for_order(@order)
      options = { resend: false }.merge(options)
      @store = @order.store
      subject = (options[: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
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
solidus_core-2.4.2 app/mailers/spree/carton_mailer.rb
solidus_core-2.3.1 app/mailers/spree/carton_mailer.rb
solidus_core-2.4.1 app/mailers/spree/carton_mailer.rb
solidus_core-2.2.2 app/mailers/spree/carton_mailer.rb
solidus_core-2.1.1 app/mailers/spree/carton_mailer.rb
solidus_core-2.4.0 app/mailers/spree/carton_mailer.rb
solidus_core-2.4.0.rc1 app/mailers/spree/carton_mailer.rb
solidus_core-2.4.0.beta1 app/mailers/spree/carton_mailer.rb
solidus_core-2.3.0 app/mailers/spree/carton_mailer.rb
solidus_core-2.3.0.rc3 app/mailers/spree/carton_mailer.rb
solidus_core-2.3.0.rc2 app/mailers/spree/carton_mailer.rb
solidus_core-2.3.0.rc1 app/mailers/spree/carton_mailer.rb
solidus_core-2.3.0.beta1 app/mailers/spree/carton_mailer.rb
solidus_core-2.2.1 app/mailers/spree/carton_mailer.rb
solidus_core-2.2.0 app/mailers/spree/carton_mailer.rb
solidus_core-2.2.0.rc1 app/mailers/spree/carton_mailer.rb
solidus_core-2.2.0.beta1 app/mailers/spree/carton_mailer.rb
solidus_core-2.1.0 app/mailers/spree/carton_mailer.rb
solidus_core-2.1.0.rc1 app/mailers/spree/carton_mailer.rb