mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-27 03:22:54 +02:00
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
|