Class: HelpCenter::UserMailer

Inherits:
ApplicationMailer
  • Object
show all
Defined in:
app/mailers/help_center/user_mailer.rb

Instance Method Summary collapse

Instance Method Details

#new_post(support_post, recipient) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/mailers/help_center/user_mailer.rb', line 18

def new_post(support_post, recipient)
  @support_post   = support_post
  @support_thread = support_post.support_thread
  @recipient    = recipient

  mail(
    to: "#{@recipient.name} <#{@recipient.email}>",
    subject: "New post in #{@support_thread.title}"
  )
end

#new_thread(support_thread, recipient) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'app/mailers/help_center/user_mailer.rb', line 7

def new_thread(support_thread, recipient)
  @support_thread = support_thread
  @support_post   = support_thread.support_posts.first
  @recipient    = recipient

  mail(
    to: "#{@recipient.name} <#{@recipient.email}>",
    subject: @support_thread.title
  )
end