mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 20:48:22 +02:00
Merge branch '107821878-emails' into staging
This commit is contained in:
commit
58db716af7
3 changed files with 6 additions and 6 deletions
|
@ -1,8 +1,9 @@
|
||||||
class DomainMailer < ApplicationMailer
|
class DomainMailer < ApplicationMailer
|
||||||
include Que::Mailer
|
include Que::Mailer
|
||||||
|
|
||||||
def pending_update_request_for_old_registrant(domain_id, should_deliver)
|
def pending_update_request_for_old_registrant(domain_id, old_registrant_id, should_deliver)
|
||||||
@domain = Domain.find_by(id: domain_id)
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
@old_registrant = Registrant.find(old_registrant_id)
|
||||||
return unless @domain
|
return unless @domain
|
||||||
return if delivery_off?(@domain, should_deliver)
|
return if delivery_off?(@domain, should_deliver)
|
||||||
|
|
||||||
|
@ -16,8 +17,6 @@ class DomainMailer < ApplicationMailer
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@old_registrant = Registrant.find(@domain.registrant_id_was)
|
|
||||||
|
|
||||||
confirm_path = "#{ENV['registrant_url']}/registrant/domain_update_confirms"
|
confirm_path = "#{ENV['registrant_url']}/registrant/domain_update_confirms"
|
||||||
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
||||||
|
|
||||||
|
|
|
@ -438,6 +438,7 @@ class Domain < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_update!
|
def pending_update!
|
||||||
|
old_registrar_id = registrar_id
|
||||||
return true if pending_update?
|
return true if pending_update?
|
||||||
self.epp_pending_update = true # for epp
|
self.epp_pending_update = true # for epp
|
||||||
|
|
||||||
|
@ -449,7 +450,7 @@ class Domain < ActiveRecord::Base
|
||||||
new_registrant_email = registrant.email
|
new_registrant_email = registrant.email
|
||||||
new_registrant_name = registrant.name
|
new_registrant_name = registrant.name
|
||||||
|
|
||||||
DomainMailer.pending_update_request_for_old_registrant(id, deliver_emails).deliver
|
DomainMailer.pending_update_request_for_old_registrant(id, old_registrar_id, deliver_emails).deliver
|
||||||
DomainMailer.pending_update_notification_for_new_registrant(id, deliver_emails).deliver
|
DomainMailer.pending_update_notification_for_new_registrant(id, deliver_emails).deliver
|
||||||
|
|
||||||
reload # revert back to original
|
reload # revert back to original
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe DomainMailer do
|
||||||
before :all do
|
before :all do
|
||||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||||
@domain = Fabricate(:domain, registrant: @registrant)
|
@domain = Fabricate(:domain, registrant: @registrant)
|
||||||
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain.id, deliver_emails)
|
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain.id, @registrant.id,deliver_emails)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not render email subject' do
|
it 'should not render email subject' do
|
||||||
|
@ -38,7 +38,7 @@ describe DomainMailer do
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@domain.registrant = @new_registrant
|
@domain.registrant = @new_registrant
|
||||||
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain.id, deliver_emails)
|
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain.id, @registrant.id, deliver_emails)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue