Class: NotifyUser::NotificationMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/notify_user/notification_mailer.rb

Instance Method Summary collapse

Instance Method Details

#aggregate_notifications_email(notifications, options) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'app/mailers/notify_user/notification_mailer.rb', line 16

def aggregate_notifications_email(notifications, options)
  @notifications = notifications

  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: options[:aggregate][:subject],
       from: NotifyUser.mailer_sender
end

#notification_email(notification, options) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/mailers/notify_user/notification_mailer.rb', line 6

def notification_email(notification, options)
  @notification = notification

  mail to: notification.target.email,
       subject: options[:subject],
       template_name: "notification",
       template_path: "notify_user/action_mailer",
       from: NotifyUser.mailer_sender
end