Story #109367018 - add new model to handle domain values are changing, and need to be captured now, not later

New model will provide data to DomainMailer customized as needed for the invocation reason as passed via symbol to
send_mail(). The mail templetes then required modification to use the new data model. This should handle all the data
errors in the update process, including pendingUpdate, confirmed, rejected or expired.
This commit is contained in:
Matt Farnsworth 2015-12-16 16:14:05 +02:00
parent 2c916001ad
commit 51a5798914
17 changed files with 366 additions and 254 deletions

View file

@ -500,7 +500,6 @@ class Epp::Domain < Domain
# rubocop: enable Metrics/CyclomaticComplexity
def apply_pending_update!
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id, deliver_emails)
preclean_pendings
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
@ -512,8 +511,8 @@ class Epp::Domain < Domain
return unless update(frame, user, false)
clean_pendings!
self.deliver_emails = true # turn on email delivery
DomainMailer.registrant_updated_notification_for_new_registrant(id, deliver_emails).deliver
old_registrant_email.deliver
send_mail :registrant_updated_notification_for_old_registrant
send_mail :registrant_updated_notification_for_new_registrant
true
end