Events provided by the scheduler extension
The system extension typo3/cms-scheduler provides the following events:
Table of contents
ModifyNewSchedulerTaskWizardItemsEvent
The PSR-14 event
\TYPO3\
allows extensions to modify the items in the
scheduler task wizard.
See also
ModifyNewSchedulerTaskWizardItemsEvent (TYPO3 explained) for examples and the api information.
AfterTaskExecutionEvent
The PSR-14 event
\TYPO3\
is dispatched after a scheduled task (including command tasks) has been executed.
It provides the following information:
get— the executed task objectTask (): Abstract Task is— whether the task completed without exceptionSuccess (): bool get— the thrown exception on failure, orException (): ?\ Throwable nullon success
Example listener:
use TYPO3\CMS\Scheduler\Event\AfterTaskExecutionEvent;
final class SchedulerTaskResultListener
{
public function __invoke(AfterTaskExecutionEvent $event): void
{
$task = $event->getTask();
$status = $event->isSuccess() ? 'success' : 'failure';
// e.g. send a notification, write to a custom log, etc.
}
}
Copied!