mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
23 lines
690 B
Ruby
23 lines
690 B
Ruby
module Domains
|
|
module ForceDelete
|
|
class NotifyByEmail < Base
|
|
def execute
|
|
return unless notify_by_email
|
|
|
|
if type == :fast_track
|
|
send_email
|
|
domain.update(contact_notification_sent_date: Time.zone.today)
|
|
else
|
|
domain.update(template_name: domain.notification_template(explicit: reason))
|
|
end
|
|
end
|
|
|
|
def send_email
|
|
DomainDeleteMailer.forced(domain: domain,
|
|
registrar: domain.registrar,
|
|
registrant: domain.registrant,
|
|
template_name: domain.notification_template).deliver_now
|
|
end
|
|
end
|
|
end
|
|
end
|