Method: Mailboxer::Models::Messageable#reply

Defined in:
lib/mailboxer/models/messageable.rb

#reply(conversation, recipients, reply_body, subject = nil, sanitize_text = true, attachment = nil) ⇒ Object

Basic reply method. USE NOT RECOMENDED. Use reply_to_sender, reply_to_all and reply_to_conversation instead.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mailboxer/models/messageable.rb', line 83

def reply(conversation, recipients, reply_body, subject=nil, sanitize_text=true, attachment=nil)
  subject = subject || "#{conversation.subject}"
  response = Mailboxer::MessageBuilder.new({
    :sender       => self,
    :conversation => conversation,
    :recipients   => recipients,
    :body         => reply_body,
    :subject      => subject,
    :attachment   => attachment
  }).build

  response.recipients.delete(self)
  response.deliver true, sanitize_text
end