21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-05 18:25:09 +02:00
chexpire/test/mailers/previews/notifications_mailer_preview.rb
Colin Darie ea610ee185
Notifications grouped of checks in error to user email.
This is not dependent of Notificatioon model.
2018-08-01 23:09:08 +02:00

22 lines
917 B
Ruby

# Preview all emails at http://localhost:3000/rails/mailers/notifications_mailer
class NotificationsMailerPreview < ActionMailer::Preview
# Preview this email at http://localhost:3000/rails/mailers/notifications_mailer/domain_expires_soon
def domain_expires_soon
check = Check.domain.first
NotificationsMailer.with(notification: check.notifications.first).domain_expires_soon
end
# Preview this email at http://localhost:3000/rails/mailers/notifications_mailer/ssl_expires_soon
def ssl_expires_soon
check = Check.ssl.first
NotificationsMailer.with(notification: check.notifications.first).ssl_expires_soon
end
# Preview this email at http://localhost:3000/rails/mailers/notifications_mailer/recurrent_failures
def recurrent_failures
user = User.first
checks = Check.consecutive_failures(2).where(user: user)
NotificationsMailer.recurrent_failures(user, checks)
end
end