Module: Spree::MailerSubscriber

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

Instance Method Summary collapse

Instance Method Details

#order_finalized(event) ⇒ Object



12
13
14
15
16
17
18
# File 'core/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 'core/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