@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add "Send an email" action to Herald for Maniphest

Summary: Fixes T4403. Supports the "send an email" action in Maniphest.

Test Plan: Wrote a "email duck" rule, then commented on a task and saw "duck" get an email.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: aran, epriestley

Maniphest Tasks: T4403

Differential Revision: https://secure.phabricator.com/D8529

+33 -6
+17 -4
src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
··· 1 1 <?php 2 2 3 - /** 4 - * @group herald 5 - */ 6 3 final class HeraldManiphestTaskAdapter extends HeraldAdapter { 7 4 8 5 private $task; 9 6 private $ccPHIDs = array(); 10 7 private $assignPHID; 11 8 private $projectPHIDs = array(); 9 + private $emailPHIDs = array(); 10 + 11 + public function getEmailPHIDs() { 12 + return $this->emailPHIDs; 13 + } 12 14 13 15 public function getAdapterApplicationClass() { 14 16 return 'PhabricatorApplicationManiphest'; ··· 98 100 case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: 99 101 return array( 100 102 self::ACTION_ADD_CC, 103 + self::ACTION_EMAIL, 101 104 self::ACTION_ASSIGN_TASK, 102 105 self::ACTION_ADD_PROJECTS, 103 106 self::ACTION_NOTHING, ··· 105 108 case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL: 106 109 return array( 107 110 self::ACTION_ADD_CC, 111 + self::ACTION_EMAIL, 108 112 self::ACTION_FLAG, 109 113 self::ACTION_ASSIGN_TASK, 110 114 self::ACTION_NOTHING, ··· 161 165 $result[] = new HeraldApplyTranscript( 162 166 $effect, 163 167 true, 164 - pht('Added address to cc list.')); 168 + pht('Added addresses to cc list.')); 169 + break; 170 + case self::ACTION_EMAIL: 171 + foreach ($effect->getTarget() as $phid) { 172 + $this->emailPHIDs[] = $phid; 173 + } 174 + $result[] = new HeraldApplyTranscript( 175 + $effect, 176 + true, 177 + pht('Added addresses to email list.')); 165 178 break; 166 179 case self::ACTION_FLAG: 167 180 $result[] = parent::applyFlagEffect(
+1 -1
src/applications/herald/storage/HeraldRule.php
··· 17 17 protected $isDisabled = 0; 18 18 protected $triggerObjectPHID; 19 19 20 - protected $configVersion = 33; 20 + protected $configVersion = 34; 21 21 22 22 // phids for which this rule has been applied 23 23 private $ruleApplied = self::ATTACHABLE;
+15 -1
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 3 3 final class ManiphestTransactionEditor 4 4 extends PhabricatorApplicationTransactionEditor { 5 5 6 + private $heraldEmailPHIDs = array(); 7 + 6 8 public function getTransactionTypes() { 7 9 $types = parent::getTransactionTypes(); 8 10 ··· 271 273 } 272 274 273 275 protected function getMailCC(PhabricatorLiskDAO $object) { 274 - return $object->getCCPHIDs(); 276 + $phids = array(); 277 + 278 + foreach ($object->getCCPHIDs() as $phid) { 279 + $phids[] = $phid; 280 + } 281 + 282 + foreach ($this->heraldEmailPHIDs as $phid) { 283 + $phids[] = $phid; 284 + } 285 + 286 + return $phids; 275 287 } 276 288 277 289 protected function buildReplyHandler(PhabricatorLiskDAO $object) { ··· 360 372 if ($save_again) { 361 373 $object->save(); 362 374 } 375 + 376 + $this->heraldEmailPHIDs = $adapter->getEmailPHIDs(); 363 377 364 378 $xactions = array(); 365 379