mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Added registrant successful email confirmation #2557
This commit is contained in:
parent
9f2d87606d
commit
8102b8f1a2
11 changed files with 169 additions and 18 deletions
|
@ -3,7 +3,7 @@ class DomainMailer < ApplicationMailer
|
|||
@domain = 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
|
||||
# turn on delivery on specific EPP request only, thus rake tasks does not deliver anything
|
||||
return if @domain.deliver_emails != true
|
||||
|
||||
if @domain.registrant_verification_token.blank?
|
||||
|
@ -25,11 +25,22 @@ class DomainMailer < ApplicationMailer
|
|||
subject: "#{I18n.t(:domain_registrant_pending_updated_subject, name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
||||
def registrant_updated(domain)
|
||||
@domain = domain
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email)
|
||||
|
||||
# turn on delivery on specific EPP request only, thus rake tasks does not deliver anything
|
||||
return if @domain.deliver_emails != true
|
||||
|
||||
mail(to: @domain.registrant_email,
|
||||
subject: "#{I18n.t(:domain_registrant_updated, name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
||||
def pending_deleted(domain)
|
||||
@domain = 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
|
||||
# turn on delivery on specific EPP request only, thus rake tasks does not deliver anything
|
||||
return if @domain.deliver_emails != true
|
||||
|
||||
if @domain.registrant_verification_token.blank?
|
||||
|
|
|
@ -186,13 +186,10 @@ class Domain < ActiveRecord::Base
|
|||
def start_expire_period
|
||||
STDOUT << "#{Time.zone.now.utc} - Expiring domains\n" unless Rails.env.test?
|
||||
|
||||
d = Domain.where('valid_to <= ?', Time.zone.now)
|
||||
d.each do |x|
|
||||
next unless x.expirable?
|
||||
x.statuses << DomainStatus::EXPIRED
|
||||
# TODO: This should be managed by automatic_statuses
|
||||
x.statuses.delete(DomainStatus::OK)
|
||||
x.save(validate: false)
|
||||
domains = Domain.where('valid_to <= ?', Time.zone.now)
|
||||
domains.each do |domain|
|
||||
next unless domain.expirable?
|
||||
domain.set_expired!
|
||||
end
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - Successfully expired #{d.count} domains\n" unless Rails.env.test?
|
||||
|
@ -517,6 +514,19 @@ class Domain < ActiveRecord::Base
|
|||
save(validate: false)
|
||||
end
|
||||
|
||||
def set_expired
|
||||
# TODO: currently valid_to attribute update logic is open
|
||||
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
|
||||
self.outzone_at = Time.zone.now + Setting.expire_warning_period.days
|
||||
self.delete_at = Time.zone.now + Setting.redemption_grace_period.days
|
||||
statuses << DomainStatus::EXPIRED
|
||||
end
|
||||
|
||||
def set_expired!
|
||||
set_expired
|
||||
save(validate: false)
|
||||
end
|
||||
|
||||
def manage_automatic_statuses
|
||||
# domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable?
|
||||
if statuses.empty? && valid?
|
||||
|
|
|
@ -398,7 +398,11 @@ class Epp::Domain < Domain
|
|||
frame = Nokogiri::XML(pending_json['frame'])
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
|
||||
clean_pendings! if update(frame, user, false)
|
||||
if update(frame, user, false)
|
||||
clean_pendings!
|
||||
self.deliver_emails = true # turn on email delivery for epp
|
||||
DomainMailer.registrant_updated(self).deliver_now
|
||||
end
|
||||
end
|
||||
|
||||
def apply_pending_delete!
|
||||
|
@ -429,7 +433,7 @@ class Epp::Domain < Domain
|
|||
manage_automatic_statuses
|
||||
true # aka 1001 pending_delete
|
||||
else
|
||||
destroy
|
||||
set_expired!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veen
|
|||
<br><br>
|
||||
Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
|
||||
<br><br>
|
||||
Taotlus on aktiivne <48> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.<br>
|
||||
Taotlus on aktiivne 48 tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.<br>
|
||||
<%= link_to @verification_url, @verification_url %>
|
||||
<br><br>
|
||||
Lugupidamisega<br>
|
||||
|
|
39
app/views/domain_mailer/registrant_updated.html.erb
Normal file
39
app/views/domain_mailer/registrant_updated.html.erb
Normal file
|
@ -0,0 +1,39 @@
|
|||
Tere,
|
||||
<br><br>
|
||||
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
|
||||
<br><br>
|
||||
Uued registreerija andmed:<br>
|
||||
Nimi: <%= @domain.registrant_name %><br>
|
||||
<% if @domain.registrant.priv? %>
|
||||
Isikukood: <%= @domain.registrant_ident %><br>
|
||||
<% else %>
|
||||
Äriregistrikood: <%= @domain.registrant_ident %><br>
|
||||
<% end %>
|
||||
Epost: <%= @domain.registrant_email %><br>
|
||||
Tänav: <%= @domain.registrant_street %><br>
|
||||
Linn: <%= @domain.registrant_city %><br>
|
||||
Riik: <%= @domain.registrant_country %>
|
||||
<br><br>
|
||||
Lugupidamisega<br>
|
||||
Eesti Interneti SA
|
||||
<br><br>
|
||||
<hr>
|
||||
<br><br>
|
||||
Hi,
|
||||
<br><br>
|
||||
Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated.
|
||||
<br><br>
|
||||
New registrant:<br>
|
||||
Name: <%= @domain.registrant_name %><br>
|
||||
<% if @domain.registrant.priv? %>
|
||||
Personal code: <%= @domain.registrant_ident %><br>
|
||||
<% else %>
|
||||
Business Registry code: <%= @domain.registrant_ident %><br>
|
||||
<% end %>
|
||||
E-mail: <%= @domain.registrant_email %><br>
|
||||
Street: <%= @domain.registrant_street %><br>
|
||||
City: <%= @domain.registrant_city %><br>
|
||||
Country: <%= @domain.registrant_country %>
|
||||
<br><br>
|
||||
Best Regards,<br>
|
||||
Estonian Internet Foundation
|
39
app/views/domain_mailer/registrant_updated.text.erb
Normal file
39
app/views/domain_mailer/registrant_updated.text.erb
Normal file
|
@ -0,0 +1,39 @@
|
|||
Tere,
|
||||
|
||||
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
|
||||
|
||||
Uued registreerija andmed:
|
||||
Nimi: <%= @domain.registrant_name %>
|
||||
<% if @domain.registrant.priv? %>
|
||||
Isikukood: <%= @domain.registrant_ident %>
|
||||
<% else %>
|
||||
Äriregistrikood: <%= @domain.registrant_ident %>
|
||||
<% end %>
|
||||
Epost: <%= @domain.registrant_email %>
|
||||
Tänav: <%= @domain.registrant_street %>
|
||||
Linn: <%= @domain.registrant_city %>
|
||||
Riik: <%= @domain.registrant_country %>
|
||||
|
||||
Lugupidamisega
|
||||
Eesti Interneti SA
|
||||
|
||||
--------------------------------------
|
||||
|
||||
Hi,
|
||||
|
||||
Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated.
|
||||
|
||||
New registrant:
|
||||
Name: <%= @domain.registrant_name %>
|
||||
<% if @domain.registrant.priv? %>
|
||||
Personal code: <%= @domain.registrant_ident %>
|
||||
<% else %>
|
||||
Business Registry code: <%= @domain.registrant_ident %>
|
||||
<% end %>
|
||||
E-mail: <%= @domain.registrant_email %>
|
||||
Street: <%= @domain.registrant_street %>
|
||||
City: <%= @domain.registrant_city %>
|
||||
Country: <%= @domain.registrant_country %>
|
||||
|
||||
Best Regards,
|
||||
Estonian Internet Foundation
|
Loading…
Add table
Add a link
Reference in a new issue