1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/applications/spaces/engineextension/PhabricatorSpacesMailEngineExtension.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

35 lines
796 B
PHP

<?php
final class PhabricatorSpacesMailEngineExtension
extends PhabricatorMailEngineExtension {
const EXTENSIONKEY = 'spaces';
public function supportsObject($object) {
return ($object instanceof PhabricatorSpacesInterface);
}
public function newMailStampTemplates($object) {
return array(
id(new PhabricatorPHIDMailStamp())
->setKey('space')
->setLabel(pht('Space')),
);
}
public function newMailStamps($object, array $xactions) {
$editor = $this->getEditor();
$viewer = $this->getViewer();
if (!PhabricatorSpacesNamespaceQuery::getSpacesExist()) {
return;
}
$space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID(
$object);
$this->getMailStamp('space')
->setValue($space_phid);
}
}