diff --git a/src/applications/differential/mail/base/DifferentialMail.php b/src/applications/differential/mail/base/DifferentialMail.php index 8ea77d456e..3b0b67c917 100644 --- a/src/applications/differential/mail/base/DifferentialMail.php +++ b/src/applications/differential/mail/base/DifferentialMail.php @@ -319,4 +319,12 @@ EOTEXT; return $this->heraldTranscriptURI; } + protected function renderHandleList(array $handles, array $phids) { + $names = array(); + foreach ($phids as $phid) { + $names[] = $handles[$phid]->getName(); + } + return implode(', ', $names); + } + } diff --git a/src/applications/differential/mail/ccwelcome/DifferentialCCWelcomeMail.php b/src/applications/differential/mail/ccwelcome/DifferentialCCWelcomeMail.php index 635f10c803..8d4b9ba00e 100644 --- a/src/applications/differential/mail/ccwelcome/DifferentialCCWelcomeMail.php +++ b/src/applications/differential/mail/ccwelcome/DifferentialCCWelcomeMail.php @@ -30,6 +30,7 @@ class DifferentialCCWelcomeMail extends DifferentialReviewRequestMail { $body = array(); $body[] = "{$actor} added you to the CC list for the revision \"{$name}\"."; + $body[] = $this->renderReviewersLine(); $body[] = null; $body[] = $this->renderReviewRequestBody(); diff --git a/src/applications/differential/mail/comment/DifferentialCommentMail.php b/src/applications/differential/mail/comment/DifferentialCommentMail.php index fb5695dee0..417f1e147b 100644 --- a/src/applications/differential/mail/comment/DifferentialCommentMail.php +++ b/src/applications/differential/mail/comment/DifferentialCommentMail.php @@ -160,12 +160,4 @@ class DifferentialCommentMail extends DifferentialMail { return implode("\n", $body); } - - private function renderHandleList(array $handles, array $phids) { - $names = array(); - foreach ($phids as $phid) { - $names[] = $handles[$phid]->getName(); - } - return implode(', ', $names); - } } diff --git a/src/applications/differential/mail/newdiff/DifferentialNewDiffMail.php b/src/applications/differential/mail/newdiff/DifferentialNewDiffMail.php index 9b18f6fd67..6082be50fb 100644 --- a/src/applications/differential/mail/newdiff/DifferentialNewDiffMail.php +++ b/src/applications/differential/mail/newdiff/DifferentialNewDiffMail.php @@ -58,6 +58,7 @@ class DifferentialNewDiffMail extends DifferentialReviewRequestMail { } else { $body[] = "{$actor} updated the revision \"{$name}\"."; } + $body[] = $this->renderReviewersLine(); $body[] = null; $body[] = $this->renderReviewRequestBody(); diff --git a/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php b/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php index 0fc013363c..95ad604a5b 100644 --- a/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php +++ b/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php @@ -39,6 +39,12 @@ abstract class DifferentialReviewRequestMail extends DifferentialMail { $this->setChangesets($changesets); } + protected function renderReviewersLine() { + $reviewers = $this->getRevision()->getReviewers(); + $handles = id(new PhabricatorObjectHandleData($reviewers))->loadHandles(); + return 'Reviewers: '.$this->renderHandleList($handles, $reviewers); + } + protected function renderReviewRequestBody() { $revision = $this->getRevision(); diff --git a/src/applications/differential/mail/reviewrequest/__init__.php b/src/applications/differential/mail/reviewrequest/__init__.php index 2411be0156..2189b1648a 100644 --- a/src/applications/differential/mail/reviewrequest/__init__.php +++ b/src/applications/differential/mail/reviewrequest/__init__.php @@ -7,6 +7,9 @@ phutil_require_module('phabricator', 'applications/differential/mail/base'); +phutil_require_module('phabricator', 'applications/phid/handle/data'); + +phutil_require_module('phutil', 'utils'); phutil_require_source('DifferentialReviewRequestMail.php');