mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
Registrant change confirmation logic
This commit is contained in:
parent
762054e5f1
commit
6c47124a28
15 changed files with 292 additions and 17 deletions
13
app/mailers/domain_mailer.rb
Normal file
13
app/mailers/domain_mailer.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
class DomainMailer < ApplicationMailer
|
||||
def registrant_updated(domain)
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(domain.registrant_email)
|
||||
# turn on delivery on specific request only, thus rake tasks does not deliver anything
|
||||
return if domain.deliver_emails != true
|
||||
|
||||
@old_registrant = Registrant.find(domain.registrant_id_was)
|
||||
|
||||
@domain = domain
|
||||
mail(to: @old_registrant.email,
|
||||
subject: "#{I18n.t(:domain_registrant_update_subject, name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
class InvoiceMailer < ApplicationMailer
|
||||
def invoice_email(invoice, pdf)
|
||||
return if Rails.env.production? ? false : TEST_EMAILS.include?(invoice.billing_email)
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(invoice.billing_email)
|
||||
|
||||
@invoice = invoice
|
||||
attachments[invoice.pdf_name] = pdf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue