From 3822525ffc075869f7d2c04562f71eed0e8d7da8 Mon Sep 17 00:00:00 2001 From: Tobias de Bruijn Date: Mon, 2 Sep 2024 23:06:10 +0200 Subject: [PATCH] Improve debug logging --- app/mailers/mailings/devise.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/mailers/mailings/devise.rb b/app/mailers/mailings/devise.rb index cce2bbac6..3e2e6cca6 100644 --- a/app/mailers/mailings/devise.rb +++ b/app/mailers/mailings/devise.rb @@ -5,13 +5,13 @@ class Devise < ApplicationMailer include ::Devise::Controllers::UrlHelpers def confirmation_instructions(record, token, _opts = {}) - Rails.logger.debug("Sending confirmation instructions") - url = confirmation_url(record, confirmation_token: token) # FIXME: confirmation_url might occassionaly return an url to the activation page. We don't know why url = url.sub("/activate", "/confirmation") - Rails.logger.debug(url) if Rails.env.development? + if Rails.env.development? + Rails.logger.debug { "Sending confirmation instructions to #{ record.credentials.name } <#{ record.unconfirmed_email }> with activation URL #{ url }" } + end html = render_to_string(locals: { name: record.credentials.name, @@ -33,13 +33,13 @@ def confirmation_instructions(record, token, _opts = {}) end def activation_instructions(record, token, _opts = {}) - Rails.logger.debug("Sending activation instructions"); - url = new_member_confirmation_url(confirmation_token: token) # FIXME: confirmation_url might occassionaly return an url to the activation page. We don't know why url = url.sub("/confirmation", "/activate") - Rails.logger.debug(url) if Rails.env.development? + if Rails.env.development? + Rails.logger.debug { "Sending activation instructions to #{ record.credentials.name } <#{ record.email }> with activation URL #{ url }" } + end html = render_to_string(locals: { name: record.credentials.first_name,