mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +02:00
Merge pull request #1482 from internetee/1477-force-delete-all-contacts-notification
Add tech contacts & info & name@name to force delete mailer
This commit is contained in:
commit
b3e5e477ad
3 changed files with 12 additions and 3 deletions
|
@ -44,7 +44,7 @@ class DomainDeleteMailer < ApplicationMailer
|
|||
|
||||
subject = default_i18n_subject(domain_name: domain.name)
|
||||
mail(from: forced_email_from,
|
||||
to: domain.primary_contact_emails,
|
||||
to: domain.force_delete_contact_emails,
|
||||
subject: subject,
|
||||
template_path: 'mailers/domain_delete_mailer/forced',
|
||||
template_name: template_name)
|
||||
|
|
|
@ -587,6 +587,15 @@ class Domain < ApplicationRecord
|
|||
(admin_contacts.emails + [registrant.email]).uniq
|
||||
end
|
||||
|
||||
def force_delete_contact_emails
|
||||
(primary_contact_emails + tech_contacts.pluck(:email) +
|
||||
["info@#{name}", "#{prepared_domain_name}@#{name}"]).uniq
|
||||
end
|
||||
|
||||
def prepared_domain_name
|
||||
name.split('.')&.first
|
||||
end
|
||||
|
||||
def new_registrant_email
|
||||
pending_json['new_registrant_email']
|
||||
end
|
||||
|
|
|
@ -73,9 +73,9 @@ class DomainDeleteMailerTest < ActionMailer::TestCase
|
|||
|
||||
assert_emails 1
|
||||
assert_equal ['legal@registry.test'], email.from
|
||||
assert_equal %w[jane@mail.test john@inbox.test], email.to
|
||||
assert_equal @domain.force_delete_contact_emails, email.to
|
||||
assert_equal 'Domeen shop.test on kustutusmenetluses' \
|
||||
' / Domain shop.test is in deletion process' \
|
||||
' / Домен shop.test в процессе удаления', email.subject
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue