Skip to content

Commit

Permalink
Merge pull request #399 from Patta/bugfix/recipientname
Browse files Browse the repository at this point in the history
[BUGFIX] Avoid empty recipient name
  • Loading branch information
SSFGizmo authored Jun 8, 2023
2 parents 733ab56 + 9b245f5 commit 9ccca4b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Classes/Dmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,17 @@ public function sendAdvanced(array $recipientRow, string $tableNameChar): int
$this->dmailer['sys_dmail_rec']['return_path'] = str_replace('###XID###', $midRidId, $this->dmailer['sys_dmail_rec']['return_path']);

if ($returnCode) {
$recipient = $this->createRecipient($recipientRow['email'], $this->ensureCorrectEncoding($recipientRow['name']));
$recipientName = $recipientRow['name'] ?? '';
if ($recipientName == '') {
if ($recipientRow['first_name'] ?? '') {
$recipientName = $recipientRow['first_name'] . ' ';
}
if ($recipientRow['middle_name'] ?? '') {
$recipientName .= $recipientRow['middle_name'] . ' ';
}
$recipientName .= $recipientRow['last_name'] ?? '';
}
$recipient = $this->createRecipient($recipientRow['email'], $this->ensureCorrectEncoding($recipientName));
$this->sendTheMail($recipient, $recipientRow);
}
}
Expand Down

0 comments on commit 9ccca4b

Please sign in to comment.