Class: Spree::ReimbursementMailer

Inherits:
BaseMailer
  • Object
show all
Defined in:
app/mailers/spree/reimbursement_mailer.rb

Instance Method Summary collapse

Instance Method Details

#reimbursement_email(reimbursement, resend = false) ⇒ Object



5
6
7
8
9
10
11
12
# File 'app/mailers/spree/reimbursement_mailer.rb', line 5

def reimbursement_email(reimbursement, resend = false)
  @reimbursement = reimbursement.respond_to?(:id) ? reimbursement : Spree::Reimbursement.find(reimbursement)
  @order = @reimbursement.order
  current_store = @reimbursement.store || Spree::Store.default
  subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '')
  subject += "#{current_store.name} #{Spree.t('reimbursement_mailer.reimbursement_email.subject')} ##{@order.number}"
  mail(to: @order.email, from: from_address, subject: subject, store_url: current_store.storefront_url, reply_to: reply_to_address)
end