Module: Devise::Models::MultiEmailRecoverable::RecoverableExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise/multi_email/models/recoverable.rb
Instance Method Summary collapse
-
#send_reset_password_instructions(email: nil) ⇒ Object
Generates a reset-password token and sends the notification.
Instance Method Details
#send_reset_password_instructions(email: nil) ⇒ Object
Generates a reset-password token and sends the notification.
The email keyword controls which address receives the reset email for this specific call, overriding the global configuration:
-
nil(default) — defers toDevise::MultiEmail.password_reset_email_strategy(itself defaults to +:primary+). -
:primary— always send to the user’s primary email address. -
:request— send to the email the user entered in the forgot-passwordform (i.e. +current_login_email+).
Examples:
user.send_reset_password_instructions # global default (:primary)
user.send_reset_password_instructions(email: :primary)
user.send_reset_password_instructions(email: :request)
38 39 40 41 42 |
# File 'lib/devise/multi_email/models/recoverable.rb', line 38 def send_reset_password_instructions(email: nil) token = set_reset_password_token send_reset_password_instructions_notification(token, email: email) token end |