Sha256: c3495972a02b51e2f12b8ca6e5bf75871357cec57e974d9e1af120309be28fce

Contents?: true

Size: 973 Bytes

Versions: 20

Compression:

Stored size: 973 Bytes

Contents

module NotifyUser
  class NotificationMailer < ActionMailer::Base
    helper NotifyUser::ApplicationHelper

    layout "notify_user/layouts/action_mailer"
  
    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

    def aggregate_notifications_email(notifications, options)
      @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: options[:aggregate][:subject],
           from: NotifyUser.mailer_sender
    end

    protected
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
notify_user-0.0.28 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.27 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.26 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.25 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.24 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.23 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.22 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.20 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.19 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.18 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.16 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.15 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.14 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.12 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.10 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.9 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.8 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.7 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.6 app/mailers/notify_user/notification_mailer.rb
notify_user-0.0.5 app/mailers/notify_user/notification_mailer.rb