Class: MessageMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- MessageMailer
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- app/mailers/message_mailer.rb
Instance Method Summary collapse
-
#new_message_email(message, receiver) ⇒ Object
Sends an email for indicating a new message for the receiver.
-
#reply_message_email(message, receiver) ⇒ Object
Sends and email for indicating a reply in an already created conversation.
-
#send_email(message, receiver) ⇒ Object
Sends and email for indicating a new message or a reply to a receiver.
Instance Method Details
#new_message_email(message, receiver) ⇒ Object
Sends an email for indicating a new message for the receiver
17 18 19 20 21 22 23 24 25 |
# File 'app/mailers/message_mailer.rb', line 17 def (,receiver) @message = @receiver = receiver subject = .subject.to_s subject = (subject) unless subject.html_safe? mail :to => receiver.send(Mailboxer.email_method,), :subject => t('mailboxer.message_mailer.subject_new', :subject => subject), :template_name => 'new_message_email' end |
#reply_message_email(message, receiver) ⇒ Object
Sends and email for indicating a reply in an already created conversation
28 29 30 31 32 33 34 35 36 |
# File 'app/mailers/message_mailer.rb', line 28 def (,receiver) @message = @receiver = receiver subject = .subject.to_s subject = (subject) unless subject.html_safe? mail :to => receiver.send(Mailboxer.email_method,), :subject => t('mailboxer.message_mailer.subject_reply', :subject => subject), :template_name => 'reply_message_email' end |
#send_email(message, receiver) ⇒ Object
Sends and email for indicating a new message or a reply to a receiver. It calls new_message_email if notifing a new message and reply_message_email when indicating a reply to an already created conversation.
6 7 8 9 10 11 12 |
# File 'app/mailers/message_mailer.rb', line 6 def send_email(,receiver) if .conversation..size > 1 (,receiver) else (,receiver) end end |