Provide a public PHP interface to initiate a password reset and deprecate _user_mail_notify() password op

Created on 11 August 2025, 7 days ago

Problem/Motivation

_user_mail_notify() is an internal, underscore-prefixed function. Still it is widely used in contrib and likely in custom modules. Some research in #3539178-27: Extract _user_mail_notify() into a user NotificationHandler turned out a non-exhaustive list of modules which for various reasons attempt to send a password reset email.

Some modules dealing with password resets:

Steps to reproduce

Proposed resolution

Expose a public API for initiating a password reset for a particular account. A call to this API should result in a password reset email sent to the address registered with that account.

This could be part of the UserInterface:

/**
  * Returns TRUE if a password reset can be initiated on this account.
  */
public function isPasswordResetEnabled(): bool;

/**
  * Initiate a password reset for the user.
  *
  * Returns TRUE if a password reset message was sent to the owner of this account.
  */
public function initiatePasswordReset(): bool;

Deprecate the password_reset op of _user_mail_notify().

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

user system

Created by

🇨🇭Switzerland znerol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024