mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Merge branch '107821878-emails' into staging
This commit is contained in:
commit
e40ddbb134
12 changed files with 86 additions and 58 deletions
|
@ -50,7 +50,7 @@ class Contact < ActiveRecord::Base
|
|||
emails << domains.map(&:registrant_email) if domains.present?
|
||||
emails = emails.flatten.uniq
|
||||
emails.each do |e|
|
||||
ContactMailer.email_updated(e, self).deliver_now
|
||||
ContactMailer.email_updated(e, id).deliver
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -238,10 +238,10 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
count += 1
|
||||
if domain.pending_update?
|
||||
DomainMailer.pending_update_expired_notification_for_new_registrant(domain).deliver_now
|
||||
DomainMailer.pending_update_expired_notification_for_new_registrant(id).deliver
|
||||
end
|
||||
if domain.pending_delete? || domain.pending_delete_confirmation?
|
||||
DomainMailer.pending_delete_expired_notification(domain).deliver_now
|
||||
DomainMailer.pending_delete_expired_notification(id).deliver
|
||||
end
|
||||
domain.clean_pendings!
|
||||
unless Rails.env.test?
|
||||
|
@ -428,8 +428,8 @@ class Domain < ActiveRecord::Base
|
|||
new_registrant_email = registrant.email
|
||||
new_registrant_name = registrant.name
|
||||
|
||||
DomainMailer.pending_update_request_for_old_registrant(self).deliver_now
|
||||
DomainMailer.pending_update_notification_for_new_registrant(self).deliver_now
|
||||
DomainMailer.pending_update_request_for_old_registrant(id).deliver
|
||||
DomainMailer.pending_update_notification_for_new_registrant(id).deliver
|
||||
|
||||
reload # revert back to original
|
||||
|
||||
|
@ -489,7 +489,7 @@ class Domain < ActiveRecord::Base
|
|||
pending_delete_confirmation!
|
||||
save(validate: false) # should check if this did succeed
|
||||
|
||||
DomainMailer.pending_deleted(self).deliver_now
|
||||
DomainMailer.pending_deleted(id).deliver
|
||||
end
|
||||
|
||||
def pricelist(operation, period_i = nil, unit = nil)
|
||||
|
@ -619,7 +619,7 @@ class Domain < ActiveRecord::Base
|
|||
registrar.messages.create!(
|
||||
body: I18n.t('force_delete_set_on_domain', domain: name)
|
||||
)
|
||||
DomainMailer.force_delete(self).deliver_now
|
||||
DomainMailer.force_delete(id).deliver
|
||||
return true
|
||||
end
|
||||
false
|
||||
|
|
|
@ -478,7 +478,7 @@ class Epp::Domain < Domain
|
|||
# rubocop: enable Metrics/CyclomaticComplexity
|
||||
|
||||
def apply_pending_update!
|
||||
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(self)
|
||||
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id)
|
||||
preclean_pendings
|
||||
user = ApiUser.find(pending_json['current_user_id'])
|
||||
frame = Nokogiri::XML(pending_json['frame'])
|
||||
|
@ -488,8 +488,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(self).deliver_now
|
||||
old_registrant_email.deliver_now
|
||||
DomainMailer.registrant_updated_notification_for_new_registrant(id).deliver
|
||||
old_registrant_email.deliver
|
||||
true
|
||||
end
|
||||
|
||||
|
@ -497,7 +497,7 @@ class Epp::Domain < Domain
|
|||
preclean_pendings
|
||||
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
DomainMailer.delete_confirmation(self).deliver_now
|
||||
DomainMailer.delete_confirmation(id).deliver
|
||||
|
||||
# TODO: confirm that this actually makes sense
|
||||
clean_pendings! if valid? && set_pending_delete!
|
||||
|
|
|
@ -117,7 +117,7 @@ class Invoice < ActiveRecord::Base
|
|||
return false unless valid?
|
||||
return false unless billing_email.present?
|
||||
|
||||
InvoiceMailer.invoice_email(self, pdf(html)).deliver_now
|
||||
InvoiceMailer.invoice_email(id, html).deliver
|
||||
true
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue