mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-18 17:58:37 +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:
parent
87304e360f
commit
664d9fa3ed
1 changed files with 5 additions and 10 deletions
|
@ -87,10 +87,12 @@ final class PhabricatorBadgesEditor
|
||||||
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) {
|
||||||
|
@ -104,15 +106,8 @@ final class PhabricatorBadgesEditor
|
||||||
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().'/'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue