From 4eaa8065ba3efbb5cb6890ef8215ef3c4b055b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Wed, 11 Nov 2020 16:49:26 +0200 Subject: [PATCH] Mailer: Enable registrant confirm actions via REST --- app/mailers/domain_delete_mailer.rb | 7 ++++++- config/application.yml.sample | 3 +++ config/routes.rb | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/mailers/domain_delete_mailer.rb b/app/mailers/domain_delete_mailer.rb index 1f08204bf..c4190fe14 100644 --- a/app/mailers/domain_delete_mailer.rb +++ b/app/mailers/domain_delete_mailer.rb @@ -53,7 +53,12 @@ class DomainDeleteMailer < ApplicationMailer private def confirmation_url(domain) - registrant_domain_delete_confirm_url(domain, token: domain.registrant_verification_token) + base_url = ENV['registrant_portal_verifications_base_url'] + if base_url.blank? + registrant_domain_delete_confirm_url(domain, token: domain.registrant_verification_token) + else + "#{base_url}/confirmation/#{domain.name_puny}/#{domain.registrant_verification_token}" + end end def forced_email_from diff --git a/config/application.yml.sample b/config/application.yml.sample index ab64ed35e..acaa536dd 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -87,6 +87,9 @@ sk_digi_doc_service_name: 'Testimine' registrant_api_base_url: registrant_api_auth_allowed_ips: '127.0.0.1, 0.0.0.0' #ips, separated with commas +# Base URL (inc. https://) of REST registrant portal +# Leave blank to use internal registrant portal +registrant_portal_verifications_base_url: '' # # MISC diff --git a/config/routes.rb b/config/routes.rb index 107484f6e..7061f125f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -63,6 +63,7 @@ Rails.application.routes.draw do resource :registry_lock, only: %i[create destroy] end resources :contacts, only: %i[index show update], param: :uuid + resources :companies, only: %i[index] end resources :auctions, only: %i[index show update], param: :uuid