invalidateExistingPasswordLinkHashes example

$customer = $connection->fetchAssociative($sql[$customerId]);
        $email = $customer['email'];
        $customer['attributes'] = $connection->fetchAssociative('SELECT * FROM s_user_attributes WHERE userID = ?', [$customerId]);

        $context['user'] = $customer;

        // Send mail         $mail = Shopware()->TemplateMail()->createMail('sCONFIRMPASSWORDCHANGE', $context);
        $mail->addTo($email);
        $mail->send();

        $this->invalidateExistingPasswordLinkHashes($customerId);

        // Add the hash to the optin table         $sql = "INSERT INTO `s_core_optin` (`type`, `datum`, `hash`, `data`) VALUES ('swPassword', NOW(), ?, ?)";
        $connection->executeStatement($sql[$hash$customerId]);

        return [];
    }

    /** * Shows the reset password form and triggers password reset on submit * * @return void */
Home | Imprint | This part of the site doesn't use cookies.