3 final class HeraldRuleEditor
4 extends PhabricatorApplicationTransactionEditor
{
6 public function getEditorApplicationClass() {
7 return 'PhabricatorHeraldApplication';
10 public function getEditorObjectsDescription() {
11 return pht('Herald Rules');
14 protected function shouldApplyHeraldRules(
15 PhabricatorLiskDAO
$object,
20 protected function buildHeraldAdapter(
21 PhabricatorLiskDAO
$object,
23 return id(new HeraldRuleAdapter())
27 protected function shouldSendMail(
28 PhabricatorLiskDAO
$object,
33 public function getTransactionTypes() {
34 $types = parent
::getTransactionTypes();
35 $types[] = PhabricatorTransactions
::TYPE_EDGE
;
39 protected function getMailTo(PhabricatorLiskDAO
$object) {
42 $phids[] = $this->getActingAsPHID();
44 if ($object->isPersonalRule()) {
45 $phids[] = $object->getAuthorPHID();
51 protected function buildReplyHandler(PhabricatorLiskDAO
$object) {
52 return id(new HeraldRuleReplyHandler())
53 ->setMailReceiver($object);
56 protected function buildMailTemplate(PhabricatorLiskDAO
$object) {
57 $monogram = $object->getMonogram();
58 $name = $object->getName();
60 $subject = pht('%s: %s', $monogram, $name);
62 return id(new PhabricatorMetaMTAMail())
63 ->setSubject($subject);
66 protected function getMailSubjectPrefix() {
67 return pht('[Herald]');
70 protected function buildMailBody(
71 PhabricatorLiskDAO
$object,
74 $body = parent
::buildMailBody($object, $xactions);
76 $body->addLinkSection(
78 PhabricatorEnv
::getProductionURI($object->getURI()));
83 protected function supportsSearch() {