Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/metamta/herald/PhabricatorMailOutboundRoutingHeraldAction.php
12256 views
1
<?php
2
3
abstract class PhabricatorMailOutboundRoutingHeraldAction
4
extends HeraldAction {
5
6
const DO_ROUTE = 'do.route';
7
8
public function supportsObject($object) {
9
return ($object instanceof PhabricatorMetaMTAMail);
10
}
11
12
public function getActionGroupKey() {
13
return HeraldApplicationActionGroup::ACTIONGROUPKEY;
14
}
15
16
protected function applyRouting(HeraldRule $rule, $route, $phids) {
17
$adapter = $this->getAdapter();
18
$mail = $adapter->getObject();
19
$mail->addRoutingRule($route, $phids, $rule->getPHID());
20
21
$this->logEffect(
22
self::DO_ROUTE,
23
array(
24
'route' => $route,
25
'phids' => $phids,
26
));
27
}
28
29
protected function getActionEffectMap() {
30
return array(
31
self::DO_ROUTE => array(
32
'icon' => 'fa-arrow-right',
33
'color' => 'green',
34
'name' => pht('Routed Message'),
35
),
36
);
37
}
38
39
protected function renderActionEffectDescription($type, $data) {
40
switch ($type) {
41
case self::DO_ROUTE:
42
return pht('Routed mail.');
43
}
44
}
45
46
}
47
48