1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 15:52:41 +01:00
phorge-phorge/src/applications/maniphest/engineextension/ManiphestMailEngineExtension.php
epriestley 7d475eb09a Add more mail stamps: tasks, subscribers, projects, spaces
Summary: Ref T13053. Adds task stamps plus the major infrastructure applications.

Test Plan: {F5413058}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13053

Differential Revision: https://secure.phabricator.com/D18996
2018-02-06 04:05:46 -08:00

58 lines
1.6 KiB
PHP

<?php
final class ManiphestMailEngineExtension
extends PhabricatorMailEngineExtension {
const EXTENSIONKEY = 'maniphest';
public function supportsObject($object) {
return ($object instanceof ManiphestTask);
}
public function newMailStampTemplates($object) {
return array(
id(new PhabricatorPHIDMailStamp())
->setKey('author')
->setLabel(pht('Author')),
id(new PhabricatorPHIDMailStamp())
->setKey('task-owner')
->setLabel(pht('Task Owner')),
id(new PhabricatorBoolMailStamp())
->setKey('task-unassigned')
->setLabel(pht('Task Unassigned')),
id(new PhabricatorStringMailStamp())
->setKey('task-priority')
->setLabel(pht('Task Priority')),
id(new PhabricatorStringMailStamp())
->setKey('task-status')
->setLabel(pht('Task Status')),
id(new PhabricatorStringMailStamp())
->setKey('subtype')
->setLabel(pht('Subtype')),
);
}
public function newMailStamps($object, array $xactions) {
$editor = $this->getEditor();
$viewer = $this->getViewer();
$this->getMailStamp('author')
->setValue($object->getAuthorPHID());
$this->getMailStamp('task-owner')
->setValue($object->getOwnerPHID());
$this->getMailStamp('task-unassigned')
->setValue(!$object->getOwnerPHID());
$this->getMailStamp('task-priority')
->setValue($object->getPriority());
$this->getMailStamp('task-status')
->setValue($object->getStatus());
$this->getMailStamp('subtype')
->setValue($object->getSubtype());
}
}