3 final class ManiphestMailEngineExtension
4 extends PhabricatorMailEngineExtension
{
6 const EXTENSIONKEY
= 'maniphest';
8 public function supportsObject($object) {
9 return ($object instanceof ManiphestTask
);
12 public function newMailStampTemplates($object) {
14 id(new PhabricatorPHIDMailStamp())
16 ->setLabel(pht('Author')),
17 id(new PhabricatorPHIDMailStamp())
18 ->setKey('task-owner')
19 ->setLabel(pht('Task Owner')),
20 id(new PhabricatorBoolMailStamp())
21 ->setKey('task-unassigned')
22 ->setLabel(pht('Task Unassigned')),
23 id(new PhabricatorStringMailStamp())
24 ->setKey('task-priority')
25 ->setLabel(pht('Task Priority')),
26 id(new PhabricatorStringMailStamp())
27 ->setKey('task-status')
28 ->setLabel(pht('Task Status')),
29 id(new PhabricatorStringMailStamp())
31 ->setLabel(pht('Subtype')),
35 public function newMailStamps($object, array $xactions) {
36 $editor = $this->getEditor();
37 $viewer = $this->getViewer();
39 $this->getMailStamp('author')
40 ->setValue($object->getAuthorPHID());
42 $this->getMailStamp('task-owner')
43 ->setValue($object->getOwnerPHID());
45 $this->getMailStamp('task-unassigned')
46 ->setValue(!$object->getOwnerPHID());
48 $this->getMailStamp('task-priority')
49 ->setValue($object->getPriority());
51 $this->getMailStamp('task-status')
52 ->setValue($object->getStatus());
54 $this->getMailStamp('subtype')
55 ->setValue($object->getSubtype());