1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Touch up Badges emails

Summary: Ref T12270. Adds the name of the badge to the subject, fixes the double description.

Test Plan: Edit lots of badges with and without descriptions, see good emails.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12270

Differential Revision: https://secure.phabricator.com/D17449
This commit is contained in:
Chad Little 2017-03-01 19:20:24 -08:00
parent 87304e360f
commit 664d9fa3ed

View file

@ -87,10 +87,12 @@ final class PhabricatorBadgesEditor
protected function buildMailTemplate(PhabricatorLiskDAO $object) {
$name = $object->getName();
$id = $object->getID();
$name = pht('Badge %d', $id);
$topic = pht('Badge %d', $id);
$subject = pht('Badge %d: %s', $id, $name);
return id(new PhabricatorMetaMTAMail())
->setSubject($name)
->addHeader('Thread-Topic', $name);
->setSubject($subject)
->addHeader('Thread-Topic', $topic);
}
protected function getMailTo(PhabricatorLiskDAO $object) {
@ -104,15 +106,8 @@ final class PhabricatorBadgesEditor
PhabricatorLiskDAO $object,
array $xactions) {
$description = $object->getDescription();
$body = parent::buildMailBody($object, $xactions);
if (strlen($description)) {
$body->addRemarkupSection(
pht('BADGE DESCRIPTION'),
$object->getDescription());
}
$body->addLinkSection(
pht('BADGE DETAIL'),
PhabricatorEnv::getProductionURI('/badges/view/'.$object->getID().'/'));