mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Refactor contact mailer
- Send single email with new email in `to` and old email in `bcc` fields - Remove `Que::Mailer` (#895) - Add preview - DRY templates - Add tests - Extract translations - Remove useless specs
This commit is contained in:
parent
6fa1ce9128
commit
5674071838
12 changed files with 122 additions and 125 deletions
|
@ -145,8 +145,6 @@ class Epp::Contact < Contact
|
|||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
self.deliver_emails = true # turn on email delivery for epp
|
||||
|
||||
ident_frame = frame.css('ident').first
|
||||
|
||||
# https://github.com/internetee/registry/issues/576
|
||||
|
@ -175,7 +173,17 @@ class Epp::Contact < Contact
|
|||
self.upid = current_user.registrar.id if current_user.registrar
|
||||
self.up_date = Time.zone.now
|
||||
|
||||
super(at)
|
||||
self.attributes = at
|
||||
|
||||
email_changed = email_changed?
|
||||
old_email = email_was
|
||||
updated = save
|
||||
|
||||
if updated && email_changed
|
||||
ContactMailer.email_changed(contact: self, old_email: old_email).deliver_now
|
||||
end
|
||||
|
||||
updated
|
||||
end
|
||||
|
||||
def statuses_attrs(frame, action)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue