mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Merge pull request #1735 from internetee/1178-invalid-email-fd-template
Add invalid email template to ForceDelete notifications
This commit is contained in:
commit
5e6fb351ab
11 changed files with 148 additions and 40 deletions
|
@ -20,7 +20,13 @@ module Concerns::Domain::ForceDelete # rubocop:disable Metrics/ModuleLength
|
|||
end
|
||||
|
||||
def notification_template
|
||||
registrant.org? ? 'legal_person' : 'private_person'
|
||||
if contact_emails_verification_failed.present?
|
||||
'invalid_email'
|
||||
elsif registrant.org?
|
||||
'legal_person'
|
||||
else
|
||||
'private_person'
|
||||
end
|
||||
end
|
||||
|
||||
def force_delete_scheduled?
|
||||
|
|
|
@ -15,6 +15,10 @@ module Concerns
|
|||
domain: domain(billing_email))
|
||||
end
|
||||
|
||||
def email_verification_failed?
|
||||
email_verification&.failed?
|
||||
end
|
||||
|
||||
class_methods do
|
||||
def domain(email)
|
||||
Mail::Address.new(email).domain&.downcase || 'not_found'
|
||||
|
|
|
@ -642,6 +642,10 @@ class Domain < ApplicationRecord
|
|||
DNS::DomainName.new(name)
|
||||
end
|
||||
|
||||
def contact_emails_verification_failed
|
||||
contacts.select(&:email_verification_failed?)&.map(&:email)&.uniq
|
||||
end
|
||||
|
||||
def self.to_csv
|
||||
CSV.generate do |csv|
|
||||
csv << column_names
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue