mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Added delete confirm email #2786
This commit is contained in:
parent
5883452fa2
commit
f89992d120
6 changed files with 70 additions and 2 deletions
|
@ -153,4 +153,13 @@ class DomainMailer < ApplicationMailer
|
|||
subject: "#{I18n.t(:pending_delete_expired_notification_subject,
|
||||
name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
||||
def delete_confirmation(domain)
|
||||
@domain = domain
|
||||
|
||||
return if whitelist_blocked?(@domain.registrant.email)
|
||||
mail(to: @domain.registrant.email,
|
||||
subject: "#{I18n.t(:delete_confirmation_subject,
|
||||
name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -438,6 +438,7 @@ class Epp::Domain < Domain
|
|||
user = ApiUser.find(pending_json['current_user_id'])
|
||||
frame = Nokogiri::XML(pending_json['frame'])
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
DomainMailer.delete_confirmation(self).deliver_now
|
||||
|
||||
clean_pendings! if epp_destroy(frame, user, false)
|
||||
end
|
||||
|
|
15
app/views/mailers/domain_mailer/delete_confirmation.html.erb
Normal file
15
app/views/mailers/domain_mailer/delete_confirmation.html.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
Tere,
|
||||
<br><br>
|
||||
Domeeni <%= @domain.name %> kustutamise taotlus on registreerija poolt kinnitatud. Domeen <%= @domain.name %> on peatatud ja kustub registrist.
|
||||
<br><br>
|
||||
Lugupidamisega<br>
|
||||
Eesti Interneti SA
|
||||
<br><br>
|
||||
<hr>
|
||||
<br><br>
|
||||
Hi,
|
||||
<br><br>
|
||||
Domain <%= @domain.name %> deletion confirmed and will be deleted.
|
||||
<br><br>
|
||||
Best Regards,<br>
|
||||
Estonian Internet Foundation
|
15
app/views/mailers/domain_mailer/delete_confirmation.text.erb
Normal file
15
app/views/mailers/domain_mailer/delete_confirmation.text.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
Tere,
|
||||
|
||||
Domeeni <%= @domain.name %> kustutamise taotlus on registreerija poolt kinnitatud. Domeen <%= @domain.name %> on peatatud ja kustub registrist.
|
||||
|
||||
Lugupidamisega
|
||||
Eesti Interneti SA
|
||||
|
||||
--------------------------------------
|
||||
|
||||
Hi,
|
||||
|
||||
Domain <%= @domain.name %> deletion confirmed and will be deleted.
|
||||
|
||||
Best Regards,
|
||||
Estonian Internet Foundation
|
|
@ -786,6 +786,7 @@ en:
|
|||
domain_pending_deleted_subject: "Kinnitustaotlus domeeni %{name} kustutamiseks .ee registrist / Application for approval for deletion of %{name}"
|
||||
pending_delete_rejected_notification_subject: "Domeeni %{name} kustutamise taotlus tagasi lükatud / %{name) deletion declined"
|
||||
pending_delete_expired_notification_subject: "Domeeni %{name} kustutamise taotlus on tühistatud / %{name} deletion cancelled"
|
||||
delete_confirmation_subject: "Domeeni %{name} kustutatud / %{name} deleted"
|
||||
whois: WHOIS
|
||||
login_failed_check_id_card: 'Log in failed, check ID card'
|
||||
not_valid_domain_verification_title: Domain verification not available
|
||||
|
|
|
@ -276,10 +276,10 @@ describe DomainMailer do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'pending delete rejected notification' do
|
||||
describe 'pending delete expired notification' do
|
||||
before :all do
|
||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||
@domain = Fabricate(:domain, name: 'delete-pending-expired.ee', registrant: @registrant)
|
||||
@domain = Fabricate(:domain, name: 'pending-delete-expired.ee', registrant: @registrant)
|
||||
@domain.deliver_emails = true
|
||||
@domain.registrant_verification_token = '123'
|
||||
@domain.registrant_verification_asked_at = Time.zone.now
|
||||
|
@ -302,4 +302,31 @@ describe DomainMailer do
|
|||
@mail.body.encoded.should =~ /deletion cancelled/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'pending delete rejected notification' do
|
||||
before :all do
|
||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||
@domain = Fabricate(:domain, name: 'delete-confirmed.ee', registrant: @registrant)
|
||||
@domain.deliver_emails = true
|
||||
@domain.registrant_verification_token = '123'
|
||||
@domain.registrant_verification_asked_at = Time.zone.now
|
||||
@mail = DomainMailer.delete_confirmation(@domain)
|
||||
end
|
||||
|
||||
it 'should render email subject' do
|
||||
@mail.subject.should =~ /deleted/
|
||||
end
|
||||
|
||||
it 'should have sender email' do
|
||||
@mail.from.should == ["noreply@internet.ee"]
|
||||
end
|
||||
|
||||
it 'should send confirm email to old registrant email' do
|
||||
@mail.to.should == ["test@example.com"]
|
||||
end
|
||||
|
||||
it 'should render body' do
|
||||
@mail.body.encoded.should =~ /confirmed and will be deleted/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue