mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
EPP email change will send notification to registrant
This commit is contained in:
parent
73637b1a28
commit
64fec42a69
14 changed files with 330 additions and 22 deletions
|
@ -29,6 +29,13 @@ class Contact < ActiveRecord::Base
|
|||
before_validation :set_ident_country_code
|
||||
before_validation :prefix_code
|
||||
before_create :generate_auth_info
|
||||
|
||||
before_update :manage_emails
|
||||
def manage_emails
|
||||
return nil unless email_changed?
|
||||
ContactMailer.email_updated(self).deliver_now
|
||||
end
|
||||
|
||||
after_save :manage_statuses
|
||||
def manage_statuses
|
||||
ContactStatus.manage(statuses, self)
|
||||
|
@ -48,6 +55,8 @@ class Contact < ActiveRecord::Base
|
|||
BIRTHDAY # Birthday date
|
||||
]
|
||||
|
||||
attr_accessor :deliver_emails
|
||||
|
||||
class << self
|
||||
def search_by_query(query)
|
||||
res = search(code_cont: query).result
|
||||
|
|
|
@ -16,6 +16,12 @@ class DomainContact < ActiveRecord::Base
|
|||
}
|
||||
end
|
||||
|
||||
def name
|
||||
return 'Tech' if type == 'TechDomainContact'
|
||||
return 'Admin' if type == 'AdminDomainContact'
|
||||
''
|
||||
end
|
||||
|
||||
validates :contact, presence: true
|
||||
|
||||
before_save :update_contact_code_cache
|
||||
|
|
|
@ -145,7 +145,7 @@ class Epp::Contact < Contact
|
|||
at.merge!(self.class.ident_attrs(frame.css('ident').first))
|
||||
legal_frame = frame.css('legalDocument').first
|
||||
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
|
||||
|
||||
self.deliver_emails = true # turn on email delivery for epp
|
||||
super(at)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue