Merge pull request #4228 from consul/already_confirmed_user_emails

Send informative email for already confirmed users
This commit is contained in:
Sebastia
2022-04-20 09:54:37 +02:00
committed by GitHub
8 changed files with 80 additions and 11 deletions

View File

@@ -1,4 +1,17 @@
class Users::ConfirmationsController < Devise::ConfirmationsController
# POST /resource/confirmation
def create
self.resource = resource_class.send_confirmation_instructions(resource_params)
yield resource if block_given?
if successfully_sent?(resource)
Mailer.already_confirmed(resource).deliver_later unless resource.confirmation_required?
respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name))
else
respond_with(resource)
end
end
# new action, PATCH does not exist in the default Devise::ConfirmationsController
# PATCH /resource/confirmation
def update