]> git.mxchange.org Git - friendica.git/commitdiff
Fix Lookup
authornupplaPhil <admin+github@philipp.info>
Sat, 1 Feb 2020 21:42:36 +0000 (22:42 +0100)
committernupplaPhil <admin+github@philipp.info>
Sun, 2 Feb 2020 21:43:39 +0000 (22:43 +0100)
src/Util/EMailer/MailBuilder.php

index fe801bd562239941d2acbf9ee80048cd88b5c005..c2c2f75dc56a1f67902cd8298b4f87b3b61c6be8 100644 (file)
@@ -140,14 +140,17 @@ abstract class MailBuilder
        {
                if ((empty($this->recipientAddress)) &&
                    !empty($this->recipientUid)) {
-                       $user = User::getById($this->recipientUid, ['username', 'email']);
+                       $user = User::getById($this->recipientUid, ['email']);
 
                        if (!empty($user)) {
-                               $this->senderName    = $user['username'];
-                               $this->senderAddress = $user['email'];
+                               $this->recipientAddress = $user['email'];
                        }
                }
 
+               if (empty($this->recipientAddress)) {
+                       throw new InternalServerErrorException('Recipient address is missing.');
+               }
+
                if (empty($this->senderAddress) || empty($this->senderName)) {
                        throw new InternalServerErrorException('Sender address or name is missing.');
                }