Class: Workarea::Storefront::PaymentMailer

Inherits:
ApplicationMailer show all
Includes:
TransactionalMailer
Defined in:
app/mailers/workarea/storefront/payment_mailer.rb

Instance Method Summary collapse

Methods included from TransactionalMailer

#check_if_enabled

Methods inherited from ApplicationMailer

#path_to_url

Instance Method Details

#refunded(refund_id) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/mailers/workarea/storefront/payment_mailer.rb', line 6

def refunded(refund_id)
  @refund = Payment::Refund.find(refund_id)

  model = Order.find(@refund.payment_id)
  @order = Storefront::OrderViewModel.wrap(model)
  @recommendations = Storefront::EmailRecommendationsViewModel.wrap(model)

  mail(
    to: @order.email,
    subject: t(
      'workarea.storefront.email.order_refund.subject',
      order_id: @order.id
    )
  )
end