Sha256: 7bda79062f4aad497ca6d3980673e7bdd445aa35f5d45ae849c6db78fa3e6584

Contents?: true

Size: 1.34 KB

Versions: 15

Compression:

Stored size: 1.34 KB

Contents

class ActivityNotification::MailerPreview < ActionMailer::Preview

  def send_notification_email_single
    target_notification =
      case ActivityNotification.config.orm
      when :active_record then ActivityNotification::Notification.where(group: nil).first
      when :mongoid       then ActivityNotification::Notification.where(group: nil).first
      when :dynamoid      then ActivityNotification::Notification.where('group_key.null': true).first
      end
    ActivityNotification::Mailer.send_notification_email(target_notification)
  end

  def send_notification_email_with_group
    target_notification =
      case ActivityNotification.config.orm
      when :active_record then ActivityNotification::Notification.where.not(group: nil).first
      when :mongoid       then ActivityNotification::Notification.where(:group_id.nin => ["", nil]).first
      when :dynamoid      then ActivityNotification::Notification.where('group_key.not_null': true).first
      end
    ActivityNotification::Mailer.send_notification_email(target_notification)
  end

  def send_batch_notification_email
    target = User.find_by(name: 'Ichiro')
    target_notifications = target.notification_index_with_attributes(filtered_by_key: 'comment.default')
    ActivityNotification::Mailer.send_batch_notification_email(target, target_notifications, 'batch.comment.default')
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
activity_notification-2.3.3 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.3.2 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.3.1 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.3.0 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.2.4 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.2.3 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.2.2 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.2.1 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.2.0 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.1.4 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.1.3 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.1.2 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.1.1 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.1.0 spec/rails_app/lib/mailer_previews/mailer_preview.rb
activity_notification-2.0.0 spec/rails_app/lib/mailer_previews/mailer_preview.rb