2018-08-02 00:09:29 +02:00
|
|
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
|
|
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
|
|
|
|
2018-06-04 14:07:58 +02:00
|
|
|
# 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
|
2018-07-02 18:40:09 +02:00
|
|
|
check = Check.domain.first
|
|
|
|
NotificationsMailer.with(notification: check.notifications.first).domain_expires_soon
|
2018-06-04 14:07:58 +02:00
|
|
|
end
|
|
|
|
|
2018-07-02 18:40:09 +02:00
|
|
|
# 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
|
|
|
|
|
2018-08-01 17:06:20 +02:00
|
|
|
# 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)
|
2018-07-02 18:40:09 +02:00
|
|
|
end
|
2018-06-04 14:07:58 +02:00
|
|
|
end
|