diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php --- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php +++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php @@ -1,14 +1,16 @@ emailPHIDs; + } public function getAdapterApplicationClass() { return 'PhabricatorApplicationManiphest'; @@ -98,6 +100,7 @@ case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: return array( self::ACTION_ADD_CC, + self::ACTION_EMAIL, self::ACTION_ASSIGN_TASK, self::ACTION_ADD_PROJECTS, self::ACTION_NOTHING, @@ -105,6 +108,7 @@ case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL: return array( self::ACTION_ADD_CC, + self::ACTION_EMAIL, self::ACTION_FLAG, self::ACTION_ASSIGN_TASK, self::ACTION_NOTHING, @@ -161,7 +165,16 @@ $result[] = new HeraldApplyTranscript( $effect, true, - pht('Added address to cc list.')); + pht('Added addresses to cc list.')); + break; + case self::ACTION_EMAIL: + foreach ($effect->getTarget() as $phid) { + $this->emailPHIDs[] = $phid; + } + $result[] = new HeraldApplyTranscript( + $effect, + true, + pht('Added addresses to email list.')); break; case self::ACTION_FLAG: $result[] = parent::applyFlagEffect( diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -17,7 +17,7 @@ protected $isDisabled = 0; protected $triggerObjectPHID; - protected $configVersion = 33; + protected $configVersion = 34; // phids for which this rule has been applied private $ruleApplied = self::ATTACHABLE; diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -3,6 +3,8 @@ final class ManiphestTransactionEditor extends PhabricatorApplicationTransactionEditor { + private $heraldEmailPHIDs = array(); + public function getTransactionTypes() { $types = parent::getTransactionTypes(); @@ -271,7 +273,17 @@ } protected function getMailCC(PhabricatorLiskDAO $object) { - return $object->getCCPHIDs(); + $phids = array(); + + foreach ($object->getCCPHIDs() as $phid) { + $phids[] = $phid; + } + + foreach ($this->heraldEmailPHIDs as $phid) { + $phids[] = $phid; + } + + return $phids; } protected function buildReplyHandler(PhabricatorLiskDAO $object) { @@ -361,6 +373,8 @@ $object->save(); } + $this->heraldEmailPHIDs = $adapter->getEmailPHIDs(); + $xactions = array(); $assign_phid = $adapter->getAssignPHID();