Add notification on autoFD

This commit is contained in:
Alex Sherman 2021-03-22 14:21:08 +05:00
parent 81c21db392
commit 91093b274d
6 changed files with 42 additions and 10 deletions

View file

@ -11,12 +11,16 @@ module Domains
domains = domain_contacts.map(&:domain).flatten +
Domain.where(registrant_id: registrant_ids)
domains.each do |domain|
next if domain.force_delete_scheduled?
domains.each { |domain| process_force_delete(domain) unless domain.force_delete_scheduled? }
end
domain.schedule_force_delete(type: :soft,
notify_by_email: true, reason: 'invalid_email')
end
private
def process_force_delete(domain)
domain.schedule_force_delete(type: :soft,
notify_by_email: true,
reason: 'invalid_email',
email: email)
end
end
end