From ef48a2b2eebc8bb513c3b7dca1f1e4847900c058 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 28 Apr 2018 06:12:14 -0700 Subject: [PATCH] Add a "Rule Detail" link to Herald email Summary: See PHI285. Ref T13130. After recent changes Herald sends email about rules, but the mail doesn't currently actually include a link to the rule. Include a link for consistency and ease-of-use. Test Plan: Edited a rule, looked at the resulting mail, saw a link to the rule. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13130 Differential Revision: https://secure.phabricator.com/D19413 --- .../herald/editor/HeraldRuleEditor.php | 14 ++++++++++++++ src/applications/herald/storage/HeraldRule.php | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/applications/herald/editor/HeraldRuleEditor.php b/src/applications/herald/editor/HeraldRuleEditor.php index 8c83ef6597..3ba5c4f8ac 100644 --- a/src/applications/herald/editor/HeraldRuleEditor.php +++ b/src/applications/herald/editor/HeraldRuleEditor.php @@ -137,4 +137,18 @@ final class HeraldRuleEditor return pht('[Herald]'); } + + protected function buildMailBody( + PhabricatorLiskDAO $object, + array $xactions) { + + $body = parent::buildMailBody($object, $xactions); + + $body->addLinkSection( + pht('RULE DETAIL'), + PhabricatorEnv::getProductionURI($object->getURI())); + + return $body; + } + } diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php index 44ef68ac03..d2b8d36f05 100644 --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -254,6 +254,10 @@ final class HeraldRule extends HeraldDAO return 'H'.$this->getID(); } + public function getURI() { + return '/'.$this->getMonogram(); + } + /* -( Repetition Policies )------------------------------------------------ */