Skip to content

Forgotten password e-mail not sent: Malformed UTF-8 characters, possibly incorrectly encoded

After upgrading from Magento 2.3.4 to 2.4.3-p3, when I ask Magento to send the “Forgot password” email, I get instead of the expected template: Malformed UTF-8 characters, possibly incorrectly encoded.

After investigations, I observed that the rp_token retrieved in the method : MagentoCustomerModelCustomerRegistry::retrieveSecureData does not look like what was generated here: vendor/magento/module-customer/Model/AccountManagement.php:666 but more like a string of badly encoded characters.

example:

getUniqueHash generated: kVbfH1PAMkAs1drINkJ60zoy8yBHh5aw

Returned from retrieveSecureData method : .�Q��p~U%��<�A�D���H�6�

Despite my research I have not been able to find a valid solution. Has anyone encountered or seen a similar problem?