added notify class and mail action for inform

This commit is contained in:
olegphenomenon 2022-01-05 14:40:33 +02:00
parent b25ef62d78
commit ca9ca115eb
5 changed files with 54 additions and 1 deletions

View file

@ -0,0 +1,17 @@
module ContactNotification
extend self
def notify_registrar(domain:, text:)
domain.registrar.notifications.create(text: text)
end
def notify_tech_contact(domain:)
text = "DNSKEYS for #{domain.name} are invalid!"
domain.tech_domain_contacts.each do |tech|
contact = Contact.find(tech.id)
ContactInformMailer.notify(contact: contact, subject: text)
end
end
end