mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
24 lines
671 B
Ruby
24 lines
671 B
Ruby
module ContactNotification
|
|
extend self
|
|
|
|
def notify_registrar(domain:, text:)
|
|
domain.registrar.notifications.create(text: text)
|
|
end
|
|
|
|
def notify_tech_contact(domain:, nameserver: nil, reason: nil)
|
|
case reason
|
|
when 'dnssec'
|
|
domain.tech_contacts.each do |tech|
|
|
contact = Contact.find(tech.id)
|
|
|
|
ContactInformMailer.notify_dnssec(contact: contact, domain: domain).deliver_now
|
|
end
|
|
when 'nameserver'
|
|
domain.tech_contacts.each do |tech|
|
|
contact = Contact.find(tech.id)
|
|
|
|
ContactInformMailer.notify_nameserver(contact: contact, domain: domain, nameserver: nameserver).deliver_now
|
|
end
|
|
end
|
|
end
|
|
end
|