docbrown/app/controllers/confirmations_controller.rb
Michael Kohl 12a8fbddb5
Add flash message for email confirmation (#12450)
* Add flash message for email confirmation

* Fix spec
2021-01-28 09:32:04 +07:00

13 lines
537 B
Ruby

class ConfirmationsController < Devise::ConfirmationsController
FLASH_MESSAGE = "Email sent! Please contact support at %<email>s if you are "\
"having trouble receiving your confirmation instructions.".freeze
def create
self.resource = resource_class.send_confirmation_instructions(resource_params)
resource.errors.clear # Don't leak user information, like paranoid mode.
message = format(FLASH_MESSAGE, email: SiteConfig.email_addresses[:members])
flash.now[:global_notice] = message
render :new
end
end