diff --git a/app/mailers/domain_mailer.rb b/app/mailers/domain_mailer.rb index bb8c55492..8c8c2d556 100644 --- a/app/mailers/domain_mailer.rb +++ b/app/mailers/domain_mailer.rb @@ -8,6 +8,7 @@ class DomainMailer < ApplicationMailer @old_registrant = Registrant.find(old_registrant_id) @new_registrant = Registrant.find(new_registrant_id) + @address_processing = Contact.address_processing? return if whitelist_blocked?(@new_registrant.email) mail(to: format(@new_registrant.email), @@ -23,6 +24,7 @@ class DomainMailer < ApplicationMailer @old_registrant = Registrant.find(old_registrant_id) @new_registrant = Registrant.find(new_registrant_id) + @address_processing = Contact.address_processing? return if whitelist_blocked?(@old_registrant.email) mail(to: format(@old_registrant.email), diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb index 07d55e11e..9797b18b3 100644 --- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb +++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb @@ -10,9 +10,11 @@ Nimi: <%= @new_registrant.name %>
Äriregistrikood: <%= @new_registrant.ident %>
<% end %> Epost: <%= @new_registrant.email %>
+<% if @address_processing -%> Tänav: <%= @new_registrant.street %>
Linn: <%= @new_registrant.city %>
-Riik: <%= @new_registrant.country.try(:name) %> +Riik: <%= @new_registrant.country.name %> +<% end -%>

Lugupidamisega
Eesti Interneti Sihtasutus @@ -31,9 +33,11 @@ Name: <%= @new_registrant.name %>
Business Registry code: <%= @new_registrant.ident %>
<% end %> E-mail: <%= @new_registrant.email %>
+<% if @address_processing -%> Street: <%= @new_registrant.street %>
City: <%= @new_registrant.city %>
-Country: <%= @new_registrant.country.try(:name) %> +Country: <%= @new_registrant.country.name %> +<% end -%>

Best Regards,
Estonian Internet Foundation diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb index bd53aa535..fec027aaa 100644 --- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb +++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb @@ -11,9 +11,11 @@ Nimi: <%= @new_registrant.name %> Äriregistrikood: <%= @new_registrant.ident %> <% end %> Epost: <%= @new_registrant.email %> +<% if @address_processing -%> Tänav: <%= @new_registrant.street %> Linn: <%= @new_registrant.city %> -Riik: <%= @new_registrant.country.try(:name) %> +Riik: <%= @new_registrant.country.name %> +<% end -%> Lugupidamisega Eesti Interneti Sihtasutus @@ -33,9 +35,11 @@ Name: <%= @new_registrant.name %> Business Registry code: <%= @new_registrant.ident %> <% end %> E-mail: <%= @new_registrant.email %> +<% if @address_processing -%> Street: <%= @new_registrant.street %> City: <%= @new_registrant.city %> -Country: <%= @new_registrant.country.try(:name) %> +Country: <%= @new_registrant.country.name %> +<% end -%> Best Regards, Estonian Internet Foundation diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb index 3f0930d57..b1cf2ff7b 100644 --- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb +++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb @@ -10,9 +10,11 @@ Isikukood: <%= @new_registrant.ident %>
Äriregistrikood: <%= @new_registrant.ident %>
<% end %> Epost: <%= @new_registrant.email %>
+<% if @address_processing -%> Tänav: <%= @new_registrant.street %>
Linn: <%= @new_registrant.city %>
-Riik: <%= @new_registrant.country.try(:name) %> +Riik: <%= @new_registrant.country.name %> +<% end -%>

Lugupidamisega
Eesti Interneti Sihtasutus @@ -31,9 +33,11 @@ Personal code: <%= @new_registrant.ident %>
Business Registry code: <%= @new_registrant.ident %>
<% end %> E-mail: <%= @new_registrant.email %>
+<% if @address_processing -%> Street: <%= @new_registrant.street %>
City: <%= @new_registrant.city %>
-Country: <%= @new_registrant.country.try(:name) %> +Country: <%= @new_registrant.country.name %> +<% end -%>

Best Regards,
Estonian Internet Foundation diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb index 5bf78a409..5a333e662 100644 --- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb +++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb @@ -11,9 +11,11 @@ Isikukood: <%= @new_registrant.ident %> Äriregistrikood: <%= @new_registrant.ident %> <% end %> Epost: <%= @new_registrant.email %> +<% if @address_processing -%> Tänav: <%= @new_registrant.street %> Linn: <%= @new_registrant.city %> -Riik: <%= @new_registrant.country.try(:name) %> +Riik: <%= @new_registrant.country.name %> +<% end -%> Lugupidamisega Eesti Interneti Sihtasutus @@ -33,9 +35,11 @@ Personal code: <%= @new_registrant.ident %> Business Registry code: <%= @new_registrant.ident %> <% end %> E-mail: <%= @new_registrant.email %> +<% if @address_processing -%> Street: <%= @new_registrant.street %> City: <%= @new_registrant.city %> -Country: <%= @new_registrant.country.try(:name) %> +Country: <%= @new_registrant.country.name %> +<% end -%> Best Regards, Estonian Internet Foundation