Class: NotificationMailers::PrivateMessage

Inherits:
Base
  • Object
show all
Defined in:
app/mailers/notification_mailers/private_message.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

#conversationObject

Returns the value of attribute conversation


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

def conversation
  @conversation
end

#messageObject

Returns the value of attribute message


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

def message
  @message
end

#participantsObject

Returns the value of attribute participants


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

def participants
  @participants
end

Instance Method Details

#set_headers(message_id) ⇒ Object


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

def set_headers(message_id)
  @message  = Message.find_by_id(message_id)
  @conversation = @message.conversation
  @participants = @conversation.participants

  @headers[:from] = "\"#{@message.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
  @headers[:subject] = @conversation.subject.strip
  @headers[:subject] = "Re: #{@headers[:subject]}" if @conversation.messages.size > 1
end