Sha256: 53638f7670408a48bd1bc4fa99fb2075b02e90bac1d8a65b9804c32041927009

Contents?: true

Size: 634 Bytes

Versions: 9

Compression:

Stored size: 634 Bytes

Contents

module Spree
  class VendorMailer < ::Spree::BaseMailer
    def vendor_notification_email(order_id, vendor_id)
      @vendor = Spree::Vendor.find(vendor_id)
      return unless @vendor.notification_email.present?

      @order = Spree::Order.find(order_id)
      @line_items = @order.line_items.for_vendor(@vendor)
      @subtotal = @order.vendor_subtotal(@vendor)
      @total = @order.vendor_total(@vendor)
      subject = "#{Spree::Store.current.name} #{Spree.t('order_mailer.vendor_notification_email.subject')} ##{@order.number}"
      mail(to: @vendor.notification_email, from: from_address, subject: subject)
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_multi_vendor-2.5.0 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.4.1 app/mailers/spree/vendor_mailer.rb
atkhayar-dev-spree-multi-vendor-0.0.0 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.4.0 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.3.0 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.2.0 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.1.0 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.0.2 app/mailers/spree/vendor_mailer.rb
spree_multi_vendor-2.0.1 app/mailers/spree/vendor_mailer.rb