Fix Lookup
This commit is contained in:
parent
9428466d1d
commit
206b53477e
1 changed files with 6 additions and 3 deletions
|
@ -140,14 +140,17 @@ abstract class MailBuilder
|
||||||
{
|
{
|
||||||
if ((empty($this->recipientAddress)) &&
|
if ((empty($this->recipientAddress)) &&
|
||||||
!empty($this->recipientUid)) {
|
!empty($this->recipientUid)) {
|
||||||
$user = User::getById($this->recipientUid, ['username', 'email']);
|
$user = User::getById($this->recipientUid, ['email']);
|
||||||
|
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
$this->senderName = $user['username'];
|
$this->recipientAddress = $user['email'];
|
||||||
$this->senderAddress = $user['email'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($this->recipientAddress)) {
|
||||||
|
throw new InternalServerErrorException('Recipient address is missing.');
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($this->senderAddress) || empty($this->senderName)) {
|
if (empty($this->senderAddress) || empty($this->senderName)) {
|
||||||
throw new InternalServerErrorException('Sender address or name is missing.');
|
throw new InternalServerErrorException('Sender address or name is missing.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue