Merge pull request #25709 from nextcloud/backport/25707/stable20

[stable20] Send emails on password reset to the displayname
This commit is contained in:
Joas Schilling 2021-02-23 11:59:04 +01:00 committed by GitHub
commit 10a4a144d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -378,7 +378,7 @@ class LostController extends Controller {
try {
$message = $this->mailer->createMessage();
$message->setTo([$email => $user->getUID()]);
$message->setTo([$email => $user->getDisplayName()]);
$message->setFrom([$this->from => $this->defaults->getName()]);
$message->useTemplate($emailTemplate);
$this->mailer->send($message);

View File

@ -93,6 +93,9 @@ class LostControllerTest extends \Test\TestCase {
$this->existingUser->expects($this->any())
->method('getUID')
->willReturn('ExistingUser');
$this->existingUser->expects($this->any())
->method('getDisplayName')
->willReturn('Existing User');
$this->existingUser->expects($this->any())
->method('isEnabled')
->willReturn(true);
@ -344,7 +347,7 @@ class LostControllerTest extends \Test\TestCase {
$message
->expects($this->at(0))
->method('setTo')
->with(['test@example.com' => 'ExistingUser']);
->with(['test@example.com' => 'Existing User']);
$message
->expects($this->at(1))
->method('setFrom')
@ -422,7 +425,7 @@ class LostControllerTest extends \Test\TestCase {
$message
->expects($this->at(0))
->method('setTo')
->with(['test@example.com' => 'ExistingUser']);
->with(['test@example.com' => 'Existing User']);
$message
->expects($this->at(1))
->method('setFrom')
@ -494,7 +497,7 @@ class LostControllerTest extends \Test\TestCase {
$message
->expects($this->at(0))
->method('setTo')
->with(['test@example.com' => 'ExistingUser']);
->with(['test@example.com' => 'Existing User']);
$message
->expects($this->at(1))
->method('setFrom')