Class: Spree::ReimbursementMailer

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

Instance Method Summary collapse

Methods inherited from BaseMailer

#from_address, #mail, #money

Instance Method Details

#reimbursement_email(reimbursement, resend = false) ⇒ Object



3
4
5
6
7
8
9
# File 'app/mailers/spree/reimbursement_mailer.rb', line 3

def reimbursement_email(reimbursement, resend = false)
  @reimbursement = reimbursement.respond_to?(:id) ? reimbursement : Spree::Reimbursement.find(reimbursement)
  store = @reimbursement.order.store
  subject = (resend ? "[#{t('spree.resend').upcase}] " : '')
  subject += "#{store.name} #{t('.subject')} ##{@reimbursement.order.number}"
  mail(to: @reimbursement.order.email, from: from_address(store), subject: subject)
end