Skip to content

Commit

Permalink
[TASK] Add username to password recovery email salutation
Browse files Browse the repository at this point in the history
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/+/74469
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
Patta authored and sbuerk committed May 5, 2022
1 parent 77253e4 commit d09bec9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/felogin/Classes/Service/RecoveryService.php
Expand Up @@ -138,7 +138,7 @@ protected function getReceiverName(array $userInformation): string
)
);

return $displayName ?: $userInformation['username'];
return $displayName ? $displayName . ' (' . $userInformation['username'] . ')' : $userInformation['username'];
}

/**
Expand Down
Expand Up @@ -202,7 +202,7 @@ public function configurationDataProvider(): Generator
'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' => [
Expand All @@ -220,7 +220,7 @@ public function configurationDataProvider(): Generator
'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'],
];
}
Expand Down

0 comments on commit d09bec9

Please sign in to comment.