Class: Spree::BaseMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/spree/base_mailer.rb

Instance Method Summary collapse

Instance Method Details

#from_addressObject


3
4
5
# File 'app/mailers/spree/base_mailer.rb', line 3

def from_address
  Spree::Store.current.mail_from_address
end

#frontend_available?Boolean


12
13
14
# File 'app/mailers/spree/base_mailer.rb', line 12

def frontend_available?
  Spree::Core::Engine.frontend_available?
end

#mail(headers = {}, &block) ⇒ Object


17
18
19
20
# File 'app/mailers/spree/base_mailer.rb', line 17

def mail(headers = {}, &block)
  ensure_default_action_mailer_url_host
  super if Spree::Config[:send_core_emails]
end

#money(amount, currency = Spree::Config[:currency]) ⇒ Object


7
8
9
# File 'app/mailers/spree/base_mailer.rb', line 7

def money(amount, currency = Spree::Config[:currency])
  Spree::Money.new(amount, currency: currency).to_s
end