@title Events User Guide: Installing Event Listeners
@group userguide

Using Phabricator event listeners to customize behavior.

= Overview =

Phabricator allows you to install custom runtime event listeners which can react
to certain things happening (like a Maniphest Task being edited) and run custom
code to perform logging, synchronize with other systems, or modify workflows.

NOTE: This feature is new and experimental, so few events are available and
things might not be completely stable.

= Available Events =

== PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK ==

This event is dispatched before a task is edited, and allows you to respond to
or alter the edit. Data available on this event:

  - ##task## The {@class:ManiphestTask} being edited.
  - ##transactions## The list of edits (objects of class
    @{class:ManiphestTransaction}) being applied.
  - ##new## A boolean indicating if this task is being created.
  - ##mail## If this edit originates from email, the
    @{class:PhabricatorMetaMTAReceivedMail} object.

== PhabricatorEventType::TYPE_DIFFERENTIAL_WILLSENDMAIL ==

This event is dispatched before Differential sends an email, and allows you to
edit the message that will be sent.  Data available on this event:

  - ##mail## The {@class:PhabricatorMetaMTAMail} being edited.

== PhabricatorEventType::TYPE_DIFFERENTIAL_WILLMARKGENERATED ==

This event is dispatched before Differential decides if a file is generated (and
doesn't need to be reviewed) or not.  Data available on this event:

  - ##corpus## Body of the file.
  - ##is_generated## Boolean indicating if this file should be treated as
    generated.
