Class: SimpleDiscussion::UserMailer

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

Instance Method Summary collapse

Instance Method Details

#new_post(forum_post, recipient) ⇒ Object



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

def new_post(forum_post, recipient)
  @forum_post = forum_post
  @forum_thread = forum_post.forum_thread
  @recipient = recipient

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

#new_thread(forum_thread, recipient) ⇒ Object



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

def new_thread(forum_thread, recipient)
  @forum_thread = forum_thread
  @forum_post = forum_thread.forum_posts.first
  @recipient = recipient

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