mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
Fix mailer preview
This commit is contained in:
parent
781dd85f9e
commit
4010cb5a97
2 changed files with 11 additions and 6 deletions
|
@ -6,8 +6,9 @@ class ContactMailerPreview < ActionMailer::Preview
|
||||||
EXISTS(SELECT 1 FROM domain_contacts WHERE domain_contacts.contact_id =
|
EXISTS(SELECT 1 FROM domain_contacts WHERE domain_contacts.contact_id =
|
||||||
contacts.id)')
|
contacts.id)')
|
||||||
|
|
||||||
contact = contact.where.not(email: nil, country_code: nil, code: nil).first
|
contact = contact.where.not(email: nil, country_code: nil, ident_country_code: nil, code: nil)
|
||||||
|
.take
|
||||||
|
|
||||||
ContactMailer.email_changed(contact: contact, old_email: 'old@inbox.test')
|
ContactMailer.email_changed(contact: contact, old_email: 'old@inbox.test')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
class RegistrantChangeMailerPreview < ActionMailer::Preview
|
class RegistrantChangeMailerPreview < ActionMailer::Preview
|
||||||
def initialize
|
def initialize
|
||||||
@domain = Domain.first
|
@domain = Domain.joins(:registrant).where.not({ contacts: { email: nil,
|
||||||
@new_registrant = Registrant.where.not(email: nil, country_code: nil).first
|
country_code: nil,
|
||||||
|
ident_country_code: nil } }).take
|
||||||
|
@new_registrant = Registrant.where.not(email: nil,
|
||||||
|
country_code: nil,
|
||||||
|
ident_country_code: nil).take
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,7 +25,7 @@ class RegistrantChangeMailerPreview < ActionMailer::Preview
|
||||||
|
|
||||||
def accepted
|
def accepted
|
||||||
RegistrantChangeMailer.accepted(domain: @domain,
|
RegistrantChangeMailer.accepted(domain: @domain,
|
||||||
old_registrant: @domain.registrar)
|
old_registrant: @domain.registrant)
|
||||||
end
|
end
|
||||||
|
|
||||||
def rejected
|
def rejected
|
||||||
|
@ -35,4 +39,4 @@ class RegistrantChangeMailerPreview < ActionMailer::Preview
|
||||||
registrar: @domain.registrar,
|
registrar: @domain.registrar,
|
||||||
registrant: @domain.registrant)
|
registrant: @domain.registrant)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue