Class: Thredded::PrivateTopicMailer

Inherits:
BaseMailer show all
Defined in:
app/mailers/thredded/private_topic_mailer.rb

Instance Method Summary collapse

Instance Method Details

#message_notification(post_id, emails) ⇒ Object



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

def message_notification(post_id, emails)
  @post = find_record Thredded::PrivatePost, post_id
  email_details = Thredded::TopicEmailView.new(@post.postable)
  headers['X-SMTPAPI'] = email_details.smtp_api_tag('private_topic_mailer')

  mail from: email_details.no_reply,
       to: email_details.no_reply,
       bcc: emails,
       subject: [
         Thredded.email_outgoing_prefix,
         t('thredded.emails.message_notification.subject',
           user: @post.user.thredded_display_name,
           topic_title: @post.postable.title)
       ].compact.join
end