Skip to content
Snippets Groups Projects
Commit 30af95c6 authored by Gerrit Mohrmann's avatar Gerrit Mohrmann Committed by Benni Mack
Browse files

[BUGFIX] Allow EmailFinisher recipients override with TypoScript again

Resolves: #98178
Releases: main, 12.4, 11.5
Change-Id: I6ebcbb67b9cc51d7d56b1da945fdd8b05d5081dc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79868


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 51be6052
Branches
Tags
No related merge requests found
......@@ -22,6 +22,7 @@ use Symfony\Component\Mime\Address;
use TYPO3\CMS\Core\Mail\FluidEmail;
use TYPO3\CMS\Core\Mail\MailerInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Fluid\View\TemplatePaths;
use TYPO3\CMS\Form\Domain\Finishers\Exception\FinisherException;
......@@ -239,6 +240,17 @@ class EmailFinisher extends AbstractFinisher
$addresses = [];
foreach ($recipients as $address => $name) {
// The if is needed to set address and name with TypoScript
if (MathUtility::canBeInterpretedAsInteger($address)) {
if (is_array($name)) {
$address = $name[0] ?? '';
$name = $name[1] ?? '';
} else {
$address = $name;
$name = '';
}
}
if (!GeneralUtility::validEmail($address)) {
// Drop entries without valid address
continue;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment