Class: PrivateMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/private_mailer.rb

Instance Method Summary collapse

Instance Method Details

#send_private_email(from, to, object, content) ⇒ Object



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

def send_private_email(from, to, object, content)
  @content = content
  @from = from
  @to = to
  @object = object

  subject = object.nil? ? "#{@from.first_name} sent you a message" : object

  # Postmark metadatas
  ['user-id-from'] = @from.id
  ['user-id-to'] = @to.id

  mail(
    to: "#{@to.full_name} <#{@to.email}>",
    from: "#{@from.full_name} via JOGL <messages@#{Rails.configuration.email}>",
    reply_to: "#{@from.full_name} <#{@from.email}>",
    subject: subject,
    tag: 'private-message'
  )
end