@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 32 lines 819 B view raw
1<?php 2 3final class PhabricatorSubscriptionsMailEngineExtension 4 extends PhabricatorMailEngineExtension { 5 6 const EXTENSIONKEY = 'subscriptions'; 7 8 public function supportsObject($object) { 9 return ($object instanceof PhabricatorSubscribableInterface); 10 } 11 12 public function newMailStampTemplates($object) { 13 return array( 14 id(new PhabricatorPHIDMailStamp()) 15 ->setKey('subscriber') 16 ->setLabel(pht('Subscriber')), 17 ); 18 } 19 20 public function newMailStamps($object, array $xactions) { 21 $editor = $this->getEditor(); 22 $viewer = $this->getViewer(); 23 24 $subscriber_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 25 $object->getPHID(), 26 PhabricatorObjectHasSubscriberEdgeType::EDGECONST); 27 28 $this->getMailStamp('subscriber') 29 ->setValue($subscriber_phids); 30 } 31 32}