Module: Spree::MailerSubscriber

Includes:
Event::Subscriber
Defined in:
app/subscribers/spree/mailer_subscriber.rb

Instance Method Summary collapse

Methods included from Event::Subscriber

#activate, #deactivate, #event_action, included

Instance Method Details

#order_finalized(event) ⇒ Object


12
13
14
15
16
17
18
# File 'app/subscribers/spree/mailer_subscriber.rb', line 12

def order_finalized(event)
  order = event.payload[:order]
  unless order.confirmation_delivered?
    Spree::Config.order_mailer_class.confirm_email(order).deliver_later
    order.update_column(:confirmation_delivered, true)
  end
end

#send_reimbursement_email(event) ⇒ Object


20
21
22
23
# File 'app/subscribers/spree/mailer_subscriber.rb', line 20

def send_reimbursement_email(event)
  reimbursement = event.payload[:reimbursement]
  Spree::Config.reimbursement_mailer_class.reimbursement_email(reimbursement.id).deliver_later
end