How Can I Force A Magento 2 Customer Reset Password Programmatically

How can I force a customer reset his password programmatically for Magento 2

You can call ‘initiatePasswordReset’ to force Magento 2 reset their password programmatically.

$email = "demo@demo.com";

$object = \Magento\Framework\App\ObjectManager::getInstance();
$customerAccountManagement = $object->get('Magento\Customer\Model\AccountManagement');
$customerAccountManagement->initiatePasswordReset(
                    $email,
                    AccountManagement::EMAIL_RESET
);
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments