Class: Spree::OrderInventoryCancellationMailerSubscriber

Inherits:
Object
  • Object
show all
Includes:
Omnes::Subscriber
Defined in:
app/subscribers/spree/order_inventory_cancellation_mailer_subscriber.rb

Overview

Mailing after inventory units have been cancelled from a Order

Instance Method Summary collapse

Instance Method Details

#send_inventory_cancellation_email(event) ⇒ Object

Sends inventory cancellation email to the user.

Parameters:

  • event (Omnes::UnstructuredEvent)


15
16
17
18
19
20
21
22
23
24
25
# File 'app/subscribers/spree/order_inventory_cancellation_mailer_subscriber.rb', line 15

def send_inventory_cancellation_email(event)
  return unless Spree::OrderCancellations.send_cancellation_mailer

  order = event[:order]
  inventory_units = event[:inventory_units]

  Spree::Config
    .order_mailer_class
    .inventory_cancellation_email(order, inventory_units.to_a)
    .deliver_later
end