Sha256: 43cbc756aadf804b1a83b5f4ec90facc5b0e3946e4a4e92b1bcb3fb178b9be48

Contents?: true

Size: 1.73 KB

Versions: 30

Compression:

Stored size: 1.73 KB

Contents

if defined?(ActionMailer)
  # Mailer for email notification of ActivityNotificaion.
  class ActivityNotification::Mailer < ActivityNotification.config.parent_mailer.constantize
    include ActivityNotification::Mailers::Helpers

    # Sends notification email.
    #
    # @param [Notification] notification Notification instance to send email
    # @param [Hash]         options      Options for notification email
    # @option options [String, Symbol] :fallback (:default) Fallback template to use when MissingTemplate is raised
    # @return [Mail::Message|ActionMailer::DeliveryJob] Email message or its delivery job
    def send_notification_email(notification, options = {})
      options[:fallback] ||= :default
      if options[:fallback] == :none
        options.delete(:fallback)
      end
      notification_mail(notification, options)
    end

    # Sends batch notification email.
    #
    # @param [Object]              target        Target of batch notification email
    # @param [Array<Notification>] notifications Target notifications to send batch notification email
    # @param [String]              batch_key     Key of the batch notification email
    # @param [Hash]                options       Options for notification email
    # @option options [String, Symbol] :fallback  (:batch_default) Fallback template to use when MissingTemplate is raised
    # @return [Mail::Message|ActionMailer::DeliveryJob] Email message or its delivery job
    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

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
activity_notification-2.3.3 app/mailers/activity_notification/mailer.rb
activity_notification-2.3.2 app/mailers/activity_notification/mailer.rb
activity_notification-2.3.1 app/mailers/activity_notification/mailer.rb
activity_notification-2.3.0 app/mailers/activity_notification/mailer.rb
activity_notification-2.2.4 app/mailers/activity_notification/mailer.rb
activity_notification-2.2.3 app/mailers/activity_notification/mailer.rb
activity_notification-2.2.2 app/mailers/activity_notification/mailer.rb
activity_notification-2.2.1 app/mailers/activity_notification/mailer.rb
activity_notification-2.2.0 app/mailers/activity_notification/mailer.rb
activity_notification-2.1.4 app/mailers/activity_notification/mailer.rb
activity_notification-2.1.3 app/mailers/activity_notification/mailer.rb
activity_notification-2.1.2 app/mailers/activity_notification/mailer.rb
activity_notification-2.1.1 app/mailers/activity_notification/mailer.rb
activity_notification-2.1.0 app/mailers/activity_notification/mailer.rb
activity_notification-2.0.0 app/mailers/activity_notification/mailer.rb
activity_notification-1.7.1 app/mailers/activity_notification/mailer.rb
activity_notification-1.7.0 app/mailers/activity_notification/mailer.rb
activity_notification-1.6.1 app/mailers/activity_notification/mailer.rb
activity_notification-1.6.0 app/mailers/activity_notification/mailer.rb
activity_notification-1.5.1 app/mailers/activity_notification/mailer.rb