diff options
-rw-r--r-- | core/Controller/LostController.php | 2 | ||||
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index 861a701facd..eedb9eef542 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -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); diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index 4742e7ae425..fd4e27d47f1 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -94,6 +94,9 @@ class LostControllerTest extends \Test\TestCase { ->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') |