From e0ca39f6a1fa3cf15c481ec6560a16a2dc3b145d Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Thu, 19 Jun 2014 02:36:08 +1000 Subject: [PATCH] Show repository in Differential emails Summary: Ref T5137. Listing the repository in Differential emails makes it easy to filter. Test Plan: Eye-ball it. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: young_hwi, epriestley, Korvin Maniphest Tasks: T5137 Differential Revision: https://secure.phabricator.com/D9609 --- .../DifferentialRepositoryField.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/applications/differential/customfield/DifferentialRepositoryField.php b/src/applications/differential/customfield/DifferentialRepositoryField.php index b2055f5f72..80d00a4eb8 100644 --- a/src/applications/differential/customfield/DifferentialRepositoryField.php +++ b/src/applications/differential/customfield/DifferentialRepositoryField.php @@ -143,4 +143,26 @@ final class DifferentialRepositoryField return $this->renderHandleList($handles); } + public function shouldAppearInTransactionMail() { + return true; + } + + public function updateTransactionMailBody( + PhabricatorMetaMTAMailBody $body, + PhabricatorApplicationTransactionEditor $editor, + array $xactions) { + + if (!$editor->getDiffUpdateTransaction($xactions)) { + return; + } + + $repository = $this->getObject()->getRepository(); + if ($repository === null) { + return; + } + + $body->addTextSection(pht('REPOSITORY'), + $repository->getMonogram().' '.$repository->getName()); + } + }