Class: NotificationMailers::AlsoCommented

Inherits:
Base
  • Object
show all
Defined in:
app/mailers/notification_mailers/also_commented.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#recipient, #sender

Instance Method Summary collapse

Methods inherited from Base

#headers, #initialize, #name_and_address

Constructor Details

This class inherits a constructor from NotificationMailers::Base

Instance Attribute Details

#commentObject

Returns the value of attribute comment


3
4
5
# File 'app/mailers/notification_mailers/also_commented.rb', line 3

def comment
  @comment
end

Instance Method Details

#mail?Boolean


15
16
17
# File 'app/mailers/notification_mailers/also_commented.rb', line 15

def mail?
  @recipient && @sender && @comment
end

#set_headers(comment_id) ⇒ Object


6
7
8
9
10
11
12
13
# File 'app/mailers/notification_mailers/also_commented.rb', line 6

def set_headers(comment_id)
  @comment = Comment.find_by_id(comment_id)

  if mail?
    @headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
    @headers[:subject] = "Re: #{@comment.comment_email_subject}"
  end
end