mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
parent
e52c747946
commit
bebd49e5f4
11 changed files with 190 additions and 36 deletions
|
@ -47,29 +47,13 @@ class DomainMailer < ApplicationMailer
|
|||
compose_from(params)
|
||||
end
|
||||
|
||||
def pending_deleted(domain_id, old_registrant_id, should_deliver)
|
||||
@domain = Domain.find_by(id: domain_id)
|
||||
@old_registrant = Registrant.find(old_registrant_id)
|
||||
return unless @domain
|
||||
return if delivery_off?(@domain, should_deliver)
|
||||
def pending_deleted(domain:, registrant:)
|
||||
@domain = DomainPresenter.new(domain: domain, view: view_context)
|
||||
@registrar = RegistrarPresenter.new(registrar: domain.registrar, view: view_context)
|
||||
@verification_url = registrant_domain_delete_confirm_url(domain, token: domain.registrant_verification_token)
|
||||
|
||||
if @domain.registrant_verification_token.blank?
|
||||
logger.warn "EMAIL NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}"
|
||||
return
|
||||
end
|
||||
|
||||
if @domain.registrant_verification_asked_at.blank?
|
||||
logger.warn "EMAIL NOT DELIVERED: registrant_verification_asked_at is missing for #{@domain.name}"
|
||||
return
|
||||
end
|
||||
|
||||
confirm_path = "#{ENV['registrant_url']}/registrant/domain_delete_confirms"
|
||||
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
||||
|
||||
return if whitelist_blocked?(@old_registrant.email)
|
||||
mail(to: format(@old_registrant.email),
|
||||
subject: "#{I18n.t(:domain_pending_deleted_subject,
|
||||
name: @domain.name)} [#{@domain.name}]")
|
||||
subject = default_i18n_subject(domain_name: domain.name)
|
||||
mail(to: registrant.email, subject: subject)
|
||||
end
|
||||
|
||||
def pending_delete_rejected_notification(domain_id, should_deliver)
|
||||
|
|
|
@ -439,7 +439,8 @@ class Domain < ActiveRecord::Base
|
|||
pending_delete_confirmation!
|
||||
save(validate: false) # should check if this did succeed
|
||||
|
||||
DomainMailer.pending_deleted(id, registrant_id_was, deliver_emails).deliver
|
||||
previous_registrant = Registrant.find(registrant_id_was)
|
||||
DomainMailer.pending_deleted(domain: self, registrant: previous_registrant).deliver
|
||||
end
|
||||
|
||||
def cancel_pending_delete
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
Tere
|
||||
<br><br>
|
||||
Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @domain.registrar_name %> poole.
|
||||
Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole:
|
||||
|
||||
<p>
|
||||
<%= @registrar.name %><br>
|
||||
Email: <%= @registrar.email %><br>
|
||||
Telefon: <%= @registrar.phone %><br>
|
||||
Veebileht: <%= @registrar.url %>
|
||||
</p>
|
||||
|
||||
<br><br>
|
||||
Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan.
|
||||
<br><br>
|
||||
|
@ -14,7 +22,15 @@ Eesti Interneti Sihtasutus
|
|||
<br><br>
|
||||
Hi,
|
||||
<br><br>
|
||||
Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please contact your registrar <%= @domain.registrar_name %>.
|
||||
Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please contact your registrar:
|
||||
|
||||
<p>
|
||||
<%= @registrar.name %><br>
|
||||
Email: <%= @registrar.email %><br>
|
||||
Phone: <%= @registrar.phone %><br>
|
||||
Website: <%= @registrar.url %>
|
||||
</p>
|
||||
|
||||
<br><br>
|
||||
To confirm the update please visit this website, once again review the data and press approve:<br>
|
||||
<%= link_to @verification_url, @verification_url %>
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
Tere
|
||||
|
||||
Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @domain.registrar_name %> poole.
|
||||
Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole:
|
||||
|
||||
<%= @registrar.name %>
|
||||
Email: <%= @registrar.email %>
|
||||
Telefon: <%= @registrar.phone %>
|
||||
Veebileht: <%= @registrar.url %>
|
||||
|
||||
Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan.
|
||||
|
||||
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
|
||||
<%= link_to @verification_url, @verification_url %>
|
||||
<%= @verification_url %>
|
||||
|
||||
Lugupidamisega
|
||||
Eesti Interneti Sihtasutus
|
||||
|
@ -14,10 +19,15 @@ Eesti Interneti Sihtasutus
|
|||
|
||||
Hi,
|
||||
|
||||
Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please contact your registrar <%= @domain.registrar_name %>.
|
||||
Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. In case of problems please contact your registrar:
|
||||
|
||||
<%= @registrar.name %>
|
||||
Email: <%= @registrar.email %>
|
||||
Phone: <%= @registrar.phone %>
|
||||
Website: <%= @registrar.url %>
|
||||
|
||||
To confirm the update please visit this website, once again review the data and press approve:
|
||||
<%= link_to @verification_url, @verification_url %>
|
||||
<%= @verification_url %>
|
||||
|
||||
The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automatically rejected if it is not approved nor rejected before.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue