Class: Spree::OrderMailer

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

Instance Method Summary collapse

Methods inherited from BaseMailer

#from_address, #frontend_available?, #mail, #money

Instance Method Details

#cancel_email(order, resend = false) ⇒ Object


10
11
12
13
14
15
# File 'app/mailers/spree/order_mailer.rb', line 10

def cancel_email(order, resend = false)
  @order = order.respond_to?(:id) ? order : Spree::Order.find(order)
  subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '')
  subject += "#{Spree::Store.current.name} #{Spree.t('order_mailer.cancel_email.subject')} ##{@order.number}"
  mail(to: @order.email, from: from_address, subject: subject)
end

#confirm_email(order, resend = false) ⇒ Object


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

def confirm_email(order, resend = false)
  @order = order.respond_to?(:id) ? order : Spree::Order.find(order)
  subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '')
  subject += "#{Spree::Store.current.name} #{Spree.t('order_mailer.confirm_email.subject')} ##{@order.number}"
  mail(to: @order.email, from: from_address, subject: subject)
end