internetee-registry/app/interactions/force_delete_interaction/notify_by_email.rb
2020-11-11 21:16:27 +05:00

21 lines
626 B
Ruby

module ForceDeleteInteraction
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)
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