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_address(store = nil) ⇒ Object



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

def from_address(store = nil)
  if store
    store.mail_from_address
  else
    ActiveSupport::Deprecation.warn "A Spree::Store should be provided to determine the from address.", caller
    Spree::Config[:mails_from]
  end
end

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



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

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

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



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

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