Class: Spree::CloudMailer

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

Instance Method Summary collapse

Instance Method Details

#mail_to_cloud(object, mail) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/mailers/spree/cloud_mailer.rb', line 4

def mail_to_cloud(object, mail)
  @object = object
  @mail = mail
  opts = {}

  if mail.hide_recipients && Spree::Config[:hidden_recipients_to_address]
    opts[:to] = Spree::Config[:hidden_recipients_to_address]
    opts[:bcc] = mail.recipient_email
  else
    opts[:to] = mail.recipient_email
  end
  default_url_options[:host] = mail.host
  opts[:subject] =  mail.subject
  opts[:reply_to] = mail.sender_email

  mail(opts)
end