Changeset View
Changeset View
Standalone View
Standalone View
src/applications/badges/editor/PhabricatorBadgesEditor.php
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | final class PhabricatorBadgesEditor | ||||
protected function buildReplyHandler(PhabricatorLiskDAO $object) { | protected function buildReplyHandler(PhabricatorLiskDAO $object) { | ||||
return id(new PhabricatorBadgesReplyHandler()) | return id(new PhabricatorBadgesReplyHandler()) | ||||
->setMailReceiver($object); | ->setMailReceiver($object); | ||||
} | } | ||||
protected function buildMailTemplate(PhabricatorLiskDAO $object) { | protected function buildMailTemplate(PhabricatorLiskDAO $object) { | ||||
$name = $object->getName(); | $name = $object->getName(); | ||||
$id = $object->getID(); | $id = $object->getID(); | ||||
$name = pht('Badge %d', $id); | $topic = pht('Badge %d', $id); | ||||
$subject = pht('Badge %d: %s', $id, $name); | |||||
return id(new PhabricatorMetaMTAMail()) | return id(new PhabricatorMetaMTAMail()) | ||||
->setSubject($name) | ->setSubject($subject) | ||||
->addHeader('Thread-Topic', $name); | ->addHeader('Thread-Topic', $topic); | ||||
} | } | ||||
protected function getMailTo(PhabricatorLiskDAO $object) { | protected function getMailTo(PhabricatorLiskDAO $object) { | ||||
return array( | return array( | ||||
$object->getCreatorPHID(), | $object->getCreatorPHID(), | ||||
$this->requireActor()->getPHID(), | $this->requireActor()->getPHID(), | ||||
); | ); | ||||
} | } | ||||
protected function buildMailBody( | protected function buildMailBody( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
$description = $object->getDescription(); | |||||
$body = parent::buildMailBody($object, $xactions); | $body = parent::buildMailBody($object, $xactions); | ||||
if (strlen($description)) { | |||||
$body->addRemarkupSection( | |||||
pht('BADGE DESCRIPTION'), | |||||
$object->getDescription()); | |||||
} | |||||
$body->addLinkSection( | $body->addLinkSection( | ||||
pht('BADGE DETAIL'), | pht('BADGE DETAIL'), | ||||
PhabricatorEnv::getProductionURI('/badges/view/'.$object->getID().'/')); | PhabricatorEnv::getProductionURI('/badges/view/'.$object->getID().'/')); | ||||
return $body; | return $body; | ||||
} | } | ||||
protected function getMailSubjectPrefix() { | protected function getMailSubjectPrefix() { | ||||
return pht('[Badge]'); | return pht('[Badge]'); | ||||
} | } | ||||
} | } |