Class: ActivityNotification::Mailer

Inherits:
Object
  • Object
show all
Includes:
ActivityNotification::Mailers::Helpers
Defined in:
app/mailers/activity_notification/mailer.rb

Overview

Mailer for email notification of ActivityNotificaion.

Instance Method Summary collapse

Instance Method Details

#send_batch_notification_email(target, notifications, batch_key, options = {}) ⇒ Mail::Message|ActionMailer::DeliveryJob

Sends batch notification email.

Parameters:

  • target (Object)

    Target of batch notification email

  • notifications (Array<Notification>)

    Target notifications to send batch notification email

  • batch_key (String)

    Key of the batch notification email

  • options (Hash) (defaults to: {})

    Options for notification email

Options Hash (options):

  • :fallback (String, Symbol) — default: :batch_default

    Fallback template to use when MissingTemplate is raised

Returns:

  • (Mail::Message|ActionMailer::DeliveryJob)

    Email message or its delivery job



28
29
30
31
32
33
34
# File 'app/mailers/activity_notification/mailer.rb', line 28

def send_batch_notification_email(target, notifications, batch_key, options = {})
  options[:fallback] ||= :batch_default
  if options[:fallback] == :none
    options.delete(:fallback)
  end
  batch_notification_mail(target, notifications, batch_key, options)
end

#send_notification_email(notification, options = {}) ⇒ Mail::Message|ActionMailer::DeliveryJob

Sends notification email.

Parameters:

  • notification (Notification)

    Notification instance to send email

  • options (Hash) (defaults to: {})

    Options for notification email

Options Hash (options):

  • :fallback (String, Symbol) — default: :default

    Fallback template to use when MissingTemplate is raised

Returns:

  • (Mail::Message|ActionMailer::DeliveryJob)

    Email message or its delivery job



12
13
14
15
16
17
18
# File 'app/mailers/activity_notification/mailer.rb', line 12

def send_notification_email(notification, options = {})
  options[:fallback] ||= :default
  if options[:fallback] == :none
    options.delete(:fallback)
  end
  notification_mail(notification, options)
end