fix poll message spam after validation email

This commit is contained in:
olegphenomenon 2022-04-11 15:18:11 +03:00
parent 9ba7af504a
commit e320a7ced1
3 changed files with 29 additions and 16 deletions

View file

@ -6,18 +6,26 @@ module Domains
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))
template = I18n.t('force_delete_set_on_domain',
domain_name: domain.name,
outzone_date: domain.outzone_date,
purge_date: domain.purge_date)
return if domain.registrar.notifications.last.text.include? template
domain.registrar.notifications.create!(text: template)
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))
template = I18n.t('force_delete_auto_email',
domain_name: domain.name,
outzone_date: domain.outzone_date,
purge_date: domain.purge_date,
email: email)
return if domain.registrar.notifications.last.text.include? template
domain.registrar.notifications.create!(text: template)
end
end
end