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\CMS\Scheduler\Event\ModifyNewSchedulerTaskWizardItemsEvent allows extensions to modify the items in the scheduler task wizard.

AfterTaskExecutionEvent 

The PSR-14 event \TYPO3\CMS\Scheduler\Event\AfterTaskExecutionEvent is dispatched after a scheduled task (including command tasks) has been executed. It provides the following information:

  • getTask(): AbstractTask — the executed task object
  • isSuccess(): bool — whether the task completed without exception
  • getException(): ?\Throwable — the thrown exception on failure, or null on 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!