mirror of
https://github.com/Evolix/chexpire.git
synced 2024-04-25 21:40:49 +02:00
29 lines
1.1 KiB
Ruby
29 lines
1.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(check_notification: check.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(check_notification: check.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
|