Class: ToFriendMailer

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

Instance Method Summary collapse

Instance Method Details

#mail_to_friend(object, mail) ⇒ Object



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

def mail_to_friend(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
  opts[:subject] =  mail.subject
  opts[:reply_to] = mail.sender_email

  mail(opts)
end