Class: NotificationMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- NotificationMailer
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- app/mailers/notification_mailer.rb
Instance Method Summary collapse
-
#new_notification_email(notification, receiver) ⇒ Object
Sends an email for indicating a new message for the receiver.
-
#send_email(notification, receiver) ⇒ Object
Sends and email for indicating a new notification to a receiver.
Instance Method Details
#new_notification_email(notification, receiver) ⇒ Object
Sends an email for indicating a new message for the receiver
12 13 14 15 16 17 18 19 |
# File 'app/mailers/notification_mailer.rb', line 12 def new_notification_email(notification,receiver) @notification = notification @receiver = receiver mail(:to => receiver.email, :subject => "You have a new notification: " + (notification.subject)) do |format| format.html {render __method__} format.text {render __method__} end end |
#send_email(notification, receiver) ⇒ Object
Sends and email for indicating a new notification to a receiver. It calls new_notification_email.
5 6 7 |
# File 'app/mailers/notification_mailer.rb', line 5 def send_email(notification,receiver) new_notification_email(notification,receiver) end |