if (($salesChannelId !== null && !
isset($templateData['salesChannel'
])) ||
$this->
isTestMode($data)) { $criteria =
$this->
getSalesChannelDomainCriteria($salesChannelId,
$context);
/** @var SalesChannelEntity|null $salesChannel */
$salesChannel =
$this->salesChannelRepository->
search($criteria,
$context)->
get($salesChannelId);
if ($salesChannel === null
) { throw new SalesChannelNotFoundException($salesChannelId);
} $templateData['salesChannel'
] =
$salesChannel;
} elseif ($this->
templateDataContainsSalesChannel($templateData)) { $salesChannel =
$templateData['salesChannel'
];
} $senderEmail =
$data['senderMail'
] ??
$this->
getSender($data,
$salesChannelId);
if ($senderEmail === null
) { $event =
new MailErrorEvent( $context,
Level::Error,
null,
'senderMail not configured for salesChannel: ' .
$salesChannelId . '. Please check system_config \'core.basicInformation.email\'',