Merge pull request #1870 from internetee/897-fix-pending-update-emails-2

Send expired email to both registrants
This commit is contained in:
Timo Võhmar 2021-03-03 17:04:32 +02:00 committed by GitHub
commit 3644e175e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -18,7 +18,8 @@ module Domains
RegistrantChangeMailer.expired(domain: domain,
registrar: domain.registrar,
registrant: domain.registrant,
send_to: domain.new_registrant_email).deliver_later
send_to: [domain.new_registrant_email,
domain.registrant.email]).deliver_later
end
def notify_pending_delete

View file

@ -73,10 +73,12 @@ class RegistrantChangeMailerTest < ActionMailer::TestCase
email = RegistrantChangeMailer.expired(domain: @domain,
registrar: @domain.registrar,
registrant: @domain.registrant,
send_to: @domain.new_registrant_email).deliver_now
send_to: [@domain.new_registrant_email,
@domain.registrant.email],
).deliver_now
assert_emails 1
assert_equal ['william@inbox.test'], email.to
assert_equal ['william@inbox.test', @domain.registrant.email], email.to
assert_equal 'Domeeni shop.test registreerija vahetuse taotlus on tühistatud' \
' / shop.test registrant change cancelled', email.subject
end