1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-16 10:30:56 +01:00
phorge-phorge/src/applications/differential/mail/DifferentialNewDiffMail.php

38 lines
851 B
PHP
Raw Normal View History

2011-01-26 02:17:19 +01:00
<?php
final class DifferentialNewDiffMail extends DifferentialReviewRequestMail {
2011-01-26 02:17:19 +01:00
protected function renderVaryPrefix() {
2011-01-26 02:17:19 +01:00
$revision = $this->getRevision();
$line_count = $revision->getLineCount();
$lines = pht('%d line(s)', $line_count);
2011-01-26 02:17:19 +01:00
if ($this->isFirstMailToRecipients()) {
$verb = 'Request';
} else {
$verb = 'Updated';
}
return "[{$verb}, {$lines}]";
2011-01-26 02:17:19 +01:00
}
protected function renderBody() {
$actor = $this->getActorName();
$name = $this->getRevision()->getTitle();
$body = array();
if ($this->isFirstMailToRecipients()) {
$body[] = "{$actor} requested code review of \"{$name}\".";
} else {
$body[] = "{$actor} updated the revision \"{$name}\".";
}
$body[] = null;
2011-01-26 02:17:19 +01:00
$body[] = $this->renderReviewRequestBody();
return implode("\n", $body);
}
}