class UNotifier::Provider::User::ActionMailer

Public Class Methods

new(mailer, sending_method: :new_notification, notification_conditions: []) click to toggle source
Calls superclass method UNotifier::Provider::ProviderBase::new
# File lib/provider/user/action_mailer.rb, line 5
def initialize(mailer, sending_method: :new_notification, notification_conditions: [])
  super(notification_conditions: notification_conditions)
  @mailer = mailer
  @sending_method = sending_method
end

Public Instance Methods

notify(notification) click to toggle source
# File lib/provider/user/action_mailer.rb, line 11
def notify(notification)
  return unless can_notify?(notification)

  sending_method =
    if @sending_method.is_a?(Array)
      @sending_method.map { |m| m.call(notification) }&.first
    else
      @sending_method
    end

  @mailer.public_send(sending_method, notification).deliver
end
sensitive?() click to toggle source
# File lib/provider/user/action_mailer.rb, line 24
def sensitive?
  true
end