mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Add notification on autoFD
This commit is contained in:
parent
81c21db392
commit
91093b274d
6 changed files with 42 additions and 10 deletions
|
@ -13,6 +13,9 @@ module Domains
|
|||
string :reason,
|
||||
default: nil,
|
||||
description: 'Which mail template to use explicitly'
|
||||
string :email,
|
||||
default: nil,
|
||||
description: 'Possible invalid email to notify on'
|
||||
|
||||
validates :type, inclusion: { in: %i[fast_track soft] }
|
||||
end
|
||||
|
|
|
@ -2,11 +2,23 @@ module Domains
|
|||
module ForceDelete
|
||||
class NotifyRegistrar < Base
|
||||
def execute
|
||||
email.present? ? notify_with_email : notify_without_email
|
||||
end
|
||||
|
||||
def notify_without_email
|
||||
domain.registrar.notifications.create!(text: I18n.t('force_delete_set_on_domain',
|
||||
domain_name: domain.name,
|
||||
outzone_date: domain.outzone_date,
|
||||
purge_date: domain.purge_date))
|
||||
end
|
||||
|
||||
def notify_with_email
|
||||
domain.registrar.notifications.create!(text: I18n.t('force_delete_auto_email',
|
||||
domain_name: domain.name,
|
||||
outzone_date: domain.outzone_date,
|
||||
purge_date: domain.purge_date,
|
||||
email: email))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue