Skip to content

Commit 6e6844d

Browse files
MC-39757: Email to reset admin password shows "Your password reset link has expired", when using custom template
1 parent 33834ab commit 6e6844d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/code/Magento/User/view/adminhtml/email/password_reset_confirmation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!--@subject {{trans "Password Reset Confirmation for %name" name=$username}} @-->
88
<!--@vars {
99
"var store.frontend_name":"Store Name",
10-
"var user.id":"Account Holder Id",
10+
"var user.user_id":"Account Holder Id",
1111
"var user.rp_token":"Reset Password Token",
1212
"var user.name":"Account Holder Name",
1313
"store url=\"admin\/auth\/resetpassword\/\" _query_id=$user.user_id _query_token=$user.rp_token":"Reset Password URL",

dev/tests/integration/testsuite/Magento/User/Model/UserTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ public function testSendNotificationEmailsIfRequired()
591591
->get(MutableScopeConfigInterface::class);
592592
$config->setValue(
593593
'admin/emails/new_user_notification_template',
594-
$this->getCustomEmailTemplateIdForNewUserNotification(
594+
$this->getCustomEmailTemplateId(
595595
'admin_emails_new_user_notification_template'
596596
)
597597
);
@@ -621,17 +621,17 @@ public function testSendNotificationEmailsIfRequired()
621621
}
622622

623623
/**
624-
* Return email template id for new user notification
624+
* Return email template id by origin template code
625625
*
626626
* @param string $origTemplateCode
627627
* @return int|null
628628
* @throws NotFoundException
629629
*/
630-
private function getCustomEmailTemplateIdForNewUserNotification(string $origTemplateCode): ?int
630+
private function getCustomEmailTemplateId(string $origTemplateCode): ?int
631631
{
632632
$templateId = null;
633633
$templateCollection = Bootstrap::getObjectManager()
634-
->get(TemplateCollection::class);
634+
->create(TemplateCollection::class);
635635
foreach ($templateCollection as $template) {
636636
if ($template->getOrigTemplateCode() == $origTemplateCode) {
637637
$templateId = (int) $template->getId();
@@ -659,7 +659,7 @@ public function testNotificationEmailsIfResetPassword()
659659
->get(MutableScopeConfigInterface::class);
660660
$config->setValue(
661661
'admin/emails/forgot_email_template',
662-
$this->getCustomEmailTemplateIdForNewUserNotification(
662+
$this->getCustomEmailTemplateId(
663663
'admin_emails_forgot_email_template'
664664
)
665665
);

0 commit comments

Comments
 (0)