mailers: add procedure context to the confirmation link

This allows to redirect the user to the procedure they signed up for
even when the browser session is not available (like if they changed
of browser).

Fix #4738
This commit is contained in:
Pierre de La Morinerie 2020-02-24 10:55:29 +00:00 committed by GitHub Action
parent 10c940c188
commit 6664965961
8 changed files with 50 additions and 5 deletions

View file

@ -15,6 +15,7 @@ class DeviseUserMailer < Devise::Mailer
def confirmation_instructions(record, token, opts = {})
opts[:from] = NO_REPLY_EMAIL
@procedure = CurrentConfirmation.procedure_after_confirmation || nil
super
end
end