21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-18 16:38:38 +02:00
chexpire/test/mailers/previews/notifications_mailer_preview.rb
2018-08-02 00:29:53 +02:00

25 lines
1 KiB
Ruby

# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
# 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