Commit df0d68bc authored by Patrick Lenk's avatar Patrick Lenk Committed by Stefan Bürk
Browse files

[TASK] Add username to password recovery email salutation

Currently, a user can reset their password, but never gets the information what their username is.
Many users forget their login username and reset their password using their email address.
This patch adds the username in brackets after the first and last name to the salutation in the recovery email.

Resolves: #96705
Releases: main, 11.5
Change-Id: Idb18e13e453edbab8645b079b7573e91191e479b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74256

Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 7f37960a
......@@ -138,7 +138,7 @@ class RecoveryService implements RecoveryServiceInterface
)
);
return $displayName ?: $userInformation['username'];
return $displayName ? $displayName . ' (' . $userInformation['username'] . ')' : $userInformation['username'];
}
/**
......
......@@ -202,7 +202,7 @@ class RecoveryServiceTest extends UnitTestCase
'last_name' => 'Mustermann',
'username' => 'm.mustermann',
],
'receiver' => new Address('max@mustermann.de', 'Max Maximus Mustermann'),
'receiver' => new Address('max@mustermann.de', 'Max Maximus Mustermann (m.mustermann)'),
'settings' => ['dateFormat' => 'Y-m-d H:i'],
];
yield 'custom dateFormat and no middle name' => [
......@@ -220,7 +220,7 @@ class RecoveryServiceTest extends UnitTestCase
'last_name' => 'Mustermann',
'username' => 'm.mustermann',
],
'receiver' => new Address('max@mustermann.de', 'Max Mustermann'),
'receiver' => new Address('max@mustermann.de', 'Max Mustermann (m.mustermann)'),
'settings' => ['dateFormat' => 'Y-m-d'],
];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment