Skip to content

Commit

Permalink
Improve debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasDeBruijn committed Sep 2, 2024
1 parent 8440c7c commit 3822525
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/mailers/mailings/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 3822525

Please sign in to comment.