Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/engineextension/ManiphestMailEngineExtension.php
12256 views
1
<?php
2
3
final class ManiphestMailEngineExtension
4
extends PhabricatorMailEngineExtension {
5
6
const EXTENSIONKEY = 'maniphest';
7
8
public function supportsObject($object) {
9
return ($object instanceof ManiphestTask);
10
}
11
12
public function newMailStampTemplates($object) {
13
return array(
14
id(new PhabricatorPHIDMailStamp())
15
->setKey('author')
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())
30
->setKey('subtype')
31
->setLabel(pht('Subtype')),
32
);
33
}
34
35
public function newMailStamps($object, array $xactions) {
36
$editor = $this->getEditor();
37
$viewer = $this->getViewer();
38
39
$this->getMailStamp('author')
40
->setValue($object->getAuthorPHID());
41
42
$this->getMailStamp('task-owner')
43
->setValue($object->getOwnerPHID());
44
45
$this->getMailStamp('task-unassigned')
46
->setValue(!$object->getOwnerPHID());
47
48
$this->getMailStamp('task-priority')
49
->setValue($object->getPriority());
50
51
$this->getMailStamp('task-status')
52
->setValue($object->getStatus());
53
54
$this->getMailStamp('subtype')
55
->setValue($object->getSubtype());
56
}
57
58
}
59
60