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);
$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);
$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')
$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')
$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')