mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-29 12:32:53 +02:00
9886e978fe
NB: domain recurrent failures notification conditions needs to be implemented.
23 lines
553 B
Ruby
23 lines
553 B
Ruby
class NotificationsMailer < ApplicationMailer
|
|
helper :application
|
|
|
|
before_action do
|
|
@notification = params.fetch(:notification)
|
|
@check = @notification.check
|
|
end
|
|
|
|
default to: -> { @notification.recipient }
|
|
|
|
def domain_expires_soon
|
|
@expire_in_days = Integer(@check.domain_expires_at.to_date - Date.today)
|
|
|
|
subject = t(".subject", domain: @check.domain, count: @expire_in_days)
|
|
mail subject: subject
|
|
end
|
|
|
|
def domain_recurrent_failures
|
|
subject = t(".subject", domain: @check.domain)
|
|
mail subject: subject
|
|
end
|
|
end
|