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
metadata['user-id-from'] = @from.id
metadata['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
|