diff --git a/src/applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php b/src/applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php --- a/src/applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php +++ b/src/applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php @@ -30,6 +30,10 @@ return true; } + public function getMailDiffSectionHeader() { + return pht('CHANGES TO EVENT DESCRIPTION'); + } + public function newChangeDetailView() { $viewer = $this->getViewer(); diff --git a/src/applications/owners/xaction/PhabricatorOwnersPackageDescriptionTransaction.php b/src/applications/owners/xaction/PhabricatorOwnersPackageDescriptionTransaction.php --- a/src/applications/owners/xaction/PhabricatorOwnersPackageDescriptionTransaction.php +++ b/src/applications/owners/xaction/PhabricatorOwnersPackageDescriptionTransaction.php @@ -19,6 +19,10 @@ $this->renderAuthor()); } + public function getMailDiffSectionHeader() { + return pht('CHANGES TO PACKAGE DESCRIPTION'); + } + public function newChangeDetailView() { return id(new PhabricatorApplicationTransactionTextDiffDetailView()) ->setViewer($this->getViewer()) diff --git a/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php b/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php --- a/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php +++ b/src/applications/paste/xaction/PhabricatorPasteContentTransaction.php @@ -104,6 +104,10 @@ return true; } + public function getMailDiffSectionHeader() { + return pht('CHANGES TO PASTE CONTENT'); + } + public function newChangeDetailView() { $viewer = $this->getViewer(); diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -1141,9 +1141,15 @@ PhabricatorLiskDAO $object, array $xactions) { + $this->object = $object; + $this->xactions = $xactions; + // Hook for edges or other properties that may need (re-)loading $object = $this->willPublish($object, $xactions); + // The object might have changed, so reassign it. + $this->object = $object; + $messages = array(); if (!$this->getDisableEmail()) { if ($this->shouldSendMail($object, $xactions)) { @@ -2871,12 +2877,24 @@ foreach ($details as $xaction) { $details = $xaction->renderChangeDetailsForMail($body->getViewer()); if ($details !== null) { - $body->addHTMLSection(pht('EDIT DETAILS'), $details); + $label = $this->getMailDiffSectionHeader($xaction); + $body->addHTMLSection($label, $details); } } } + private function getMailDiffSectionHeader($xaction) { + $type = $xaction->getTransactionType(); + + $xtype = $this->getModularTransactionType($type); + if ($xtype) { + return $xtype->getMailDiffSectionHeader(); + } + + return pht('EDIT DETAILS'); + } + /** * @task mail */ diff --git a/src/applications/transactions/storage/PhabricatorModularTransactionType.php b/src/applications/transactions/storage/PhabricatorModularTransactionType.php --- a/src/applications/transactions/storage/PhabricatorModularTransactionType.php +++ b/src/applications/transactions/storage/PhabricatorModularTransactionType.php @@ -67,6 +67,10 @@ throw new PhutilMethodNotImplementedException(); } + public function getMailDiffSectionHeader() { + return pht('EDIT DETAILS'); + } + public function newRemarkupChanges() { return array(); }