Notification über Crons - Contao 4.13, NC 1.7 [GELÖST]
Hallo zusammen
Möchte über einen Cron ein MetaModels durchlaufen und dann pro Item eine Mail über $objNotification->send versenden!
Der Cron läuft und die MM daten kommen auch, nur das versenden geht nicht und ich erhalte die Meldung
Code:
Failed to send notification: Failed to start the session because headers have already been sent by "/home/public_html/contao/vendor/symfony/http-foundation/Response.php" at line 381.
PHP-Code:
$objNotification = Notification::findByPk(6);
if ($objNotification === null) {
System::log('The notification was not found ID 6', __METHOD__, TL_ERROR);
return;
}
foreach($arrEmploymentData as $arrItem) {
$arrTokens = $this->sendEmploymentNotification($arrItem);
// Sende die Benachrichtigung
try {
$objNotification->send($arrTokens, $GLOBALS['TL_LANGUAGE']);
} catch (\Exception $e) {
System::log("Failed to send notification: " . $e->getMessage(), __METHOD__, TL_ERROR);
}
}
Was mache ich falsch :o