[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/system/tasknotification/ -> tasknotification.php (summary)

(no description)

Copyright: (C) 2021 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 325 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PlgSystemTasknotification:: (8 methods):
  getSubscribedEvents()
  injectTaskNotificationFieldset()
  notifyFailure()
  notifyOrphan()
  notifySuccess()
  notifyFatalRecovery()
  getDataFromTask()
  sendMail()


Class: PlgSystemTasknotification  - X-Ref

This plugin implements email notification functionality for Tasks configured through the Scheduler component.
Notification configuration is supported on a per-task basis, which can be set-up through the Task item form, made
possible by injecting the notification fields into the item form with a `onContentPrepareForm` listener.<br/>

Notifications can be set-up on: task success, failure, fatal failure (task running too long or crashing the request),
or on _orphaned_ task routines (missing parent plugin - either uninstalled, disabled or no longer offering a routine
with the same ID).

getSubscribedEvents()   X-Ref

return: array

injectTaskNotificationFieldset(EventInterface $event)   X-Ref
Inject fields to support configuration of post-execution notifications into the task item form.

param: EventInterface  $event  The onContentPrepareForm event.
return: boolean True if successful.

notifyFailure(Event $event)   X-Ref
Send out email notifications on Task execution failure if task configuration allows it.

param: Event  $event  The onTaskExecuteFailure event.
return: void

notifyOrphan(Event $event)   X-Ref
Send out email notifications on orphaned task if task configuration allows.<br/>
A task is `orphaned` if the task's parent plugin has been removed/disabled, or no longer offers a task
with the same routine ID.

param: Event  $event  The onTaskRoutineNotFound event.
return: void

notifySuccess(Event $event)   X-Ref
Send out email notifications on Task execution success if task configuration allows.

param: Event  $event  The onTaskExecuteSuccess event.
return: void

notifyFatalRecovery(Event $event)   X-Ref
Send out email notifications on fatal recovery of task execution if task configuration allows.<br/>
Fatal recovery indicated that the task either crashed the parent process or its execution lasted longer
than the global task timeout (this is configurable through the Scheduler component configuration).
In the latter case, the global task timeout should be adjusted so that this false positive can be avoided.
This stands as a limitation of the Scheduler's current task execution implementation, which doesn't involve
keeping track of the parent PHP process which could enable keeping track of the task's status.

param: Event  $event  The onTaskRecoverFailure event.
return: void

getDataFromTask(Task $task)   X-Ref

param: Task  $task  A task object
return: array  An array of data to bind to a mail template.

sendMail(string $template, array $data, string $attachment = '')   X-Ref

param: string  $template    The mail template.
param: array   $data        The data to bind to the mail template.
param: string  $attachment  The attachment to send with the mail (@todo multiple)
return: void



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer