Class: NotifyUser::NotificationMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- NotifyUser::NotificationMailer
- Defined in:
- app/mailers/notify_user/notification_mailer.rb
Instance Method Summary collapse
- #aggregate_notifications_email(notifications, options) ⇒ Object
- #notification_email(notification, options) ⇒ Object
- #subject(notification, subject) ⇒ Object
Instance Method Details
#aggregate_notifications_email(notifications, options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/mailers/notify_user/notification_mailer.rb', line 17 def aggregate_notifications_email(notifications, ) @notifications = notifications @notification = notifications.first mail to: @notifications.first.target.email, template_name: "aggregate_notification", template_path: ["notify_user/#{notifications.first.class.name.underscore}/action_mailer", "notify_user/action_mailer"], subject: subject(@notification, [:aggregate][:subject]), from: NotifyUser.mailer_sender end |
#notification_email(notification, options) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/mailers/notify_user/notification_mailer.rb', line 7 def notification_email(notification, ) @notification = notification mail to: notification.target.email, subject: subject(notification, [:subject]), template_name: "notification", template_path: "notify_user/action_mailer", from: NotifyUser.mailer_sender end |
#subject(notification, subject) ⇒ Object
28 29 30 |
# File 'app/mailers/notify_user/notification_mailer.rb', line 28 def subject(notification, subject) subject % notification.params.symbolize_keys end |