1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00

Add "unblock" and "column" mail tags to Maniphest

Summary: Fixes T5769. Fixes T5861. Add mail tags for "unblock" and "column change".

Test Plan: Did unblocks and column changes, verified the mail got the right mailtags and recipient nondelivery flags.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5861, T5769

Differential Revision: https://secure.phabricator.com/D10241
This commit is contained in:
epriestley 2014-08-12 14:07:37 -07:00
parent 0420754d73
commit 8ef1ea63dd
3 changed files with 38 additions and 24 deletions

View file

@ -438,19 +438,23 @@ final class ManiphestTransactionEditor
public function getMailTagsMap() { public function getMailTagsMap() {
return array( return array(
MetaMTANotificationType::TYPE_MANIPHEST_STATUS => ManiphestTransaction::MAILTAG_STATUS =>
pht("A task's status changes."), pht("A task's status changes."),
MetaMTANotificationType::TYPE_MANIPHEST_OWNER => ManiphestTransaction::MAILTAG_OWNER =>
pht("A task's owner changes."), pht("A task's owner changes."),
MetaMTANotificationType::TYPE_MANIPHEST_PRIORITY => ManiphestTransaction::MAILTAG_PRIORITY =>
pht("A task's priority changes."), pht("A task's priority changes."),
MetaMTANotificationType::TYPE_MANIPHEST_CC => ManiphestTransaction::MAILTAG_CC =>
pht("A task's CCs change."), pht("A task's subscribers change."),
MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS => ManiphestTransaction::MAILTAG_PROJECTS =>
pht("A task's associated projects change."), pht("A task's associated projects change."),
MetaMTANotificationType::TYPE_MANIPHEST_COMMENT => ManiphestTransaction::MAILTAG_UNBLOCK =>
pht('One of the tasks a task is blocked by changes status.'),
ManiphestTransaction::MAILTAG_COLUMN =>
pht('A task is moved between columns on a workboard.'),
ManiphestTransaction::MAILTAG_COMMENT =>
pht('Someone comments on a task.'), pht('Someone comments on a task.'),
MetaMTANotificationType::TYPE_MANIPHEST_OTHER => ManiphestTransaction::MAILTAG_OTHER =>
pht('Other task activity not listed above occurs.'), pht('Other task activity not listed above occurs.'),
); );
} }

View file

@ -20,6 +20,18 @@ final class ManiphestTransaction
// so any transactions render correctly. // so any transactions render correctly.
const TYPE_ATTACH = 'attach'; const TYPE_ATTACH = 'attach';
const MAILTAG_STATUS = 'maniphest-status';
const MAILTAG_OWNER = 'maniphest-owner';
const MAILTAG_PRIORITY = 'maniphest-priority';
const MAILTAG_CC = 'maniphest-cc';
const MAILTAG_PROJECTS = 'maniphest-projects';
const MAILTAG_COMMENT = 'maniphest-comment';
const MAILTAG_COLUMN = 'maniphest-column';
const MAILTAG_UNBLOCK = 'maniphest-unblock';
const MAILTAG_OTHER = 'maniphest-other';
public function getApplicationName() { public function getApplicationName() {
return 'maniphest'; return 'maniphest';
} }
@ -828,32 +840,38 @@ final class ManiphestTransaction
$tags = array(); $tags = array();
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case self::TYPE_STATUS: case self::TYPE_STATUS:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_STATUS; $tags[] = self::MAILTAG_STATUS;
break; break;
case self::TYPE_OWNER: case self::TYPE_OWNER:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_OWNER; $tags[] = self::MAILTAG_OWNER;
break; break;
case self::TYPE_CCS: case self::TYPE_CCS:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_CC; $tags[] = self::MAILTAG_CC;
break; break;
case PhabricatorTransactions::TYPE_EDGE: case PhabricatorTransactions::TYPE_EDGE:
switch ($this->getMetadataValue('edge:type')) { switch ($this->getMetadataValue('edge:type')) {
case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST: case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS; $tags[] = self::MAILTAG_PROJECTS;
break; break;
default: default:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_OTHER; $tags[] = self::MAILTAG_OTHER;
break; break;
} }
break; break;
case self::TYPE_PRIORITY: case self::TYPE_PRIORITY:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_PRIORITY; $tags[] = self::MAILTAG_PRIORITY;
break;
case self::TYPE_UNBLOCK:
$tags[] = self::MAILTAG_UNBLOCK;
break;
case self::TYPE_PROJECT_COLUMN:
$tags[] = self::MAILTAG_COLUMN;
break; break;
case PhabricatorTransactions::TYPE_COMMENT: case PhabricatorTransactions::TYPE_COMMENT:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_COMMENT; $tags[] = self::MAILTAG_COMMENT;
break; break;
default: default:
$tags[] = MetaMTANotificationType::TYPE_MANIPHEST_OTHER; $tags[] = self::MAILTAG_OTHER;
break; break;
} }
return $tags; return $tags;

View file

@ -11,14 +11,6 @@ final class MetaMTANotificationType
const TYPE_DIFFERENTIAL_REVIEW_REQUEST = 'differential-review-request'; const TYPE_DIFFERENTIAL_REVIEW_REQUEST = 'differential-review-request';
const TYPE_DIFFERENTIAL_OTHER = 'differential-other'; const TYPE_DIFFERENTIAL_OTHER = 'differential-other';
const TYPE_MANIPHEST_STATUS = 'maniphest-status';
const TYPE_MANIPHEST_OWNER = 'maniphest-owner';
const TYPE_MANIPHEST_PRIORITY = 'maniphest-priority';
const TYPE_MANIPHEST_CC = 'maniphest-cc';
const TYPE_MANIPHEST_PROJECTS = 'maniphest-projects';
const TYPE_MANIPHEST_COMMENT = 'maniphest-comment';
const TYPE_MANIPHEST_OTHER = 'maniphest-other';
const TYPE_PHOLIO_STATUS = 'pholio-status'; const TYPE_PHOLIO_STATUS = 'pholio-status';
const TYPE_PHOLIO_COMMENT = 'pholio-comment'; const TYPE_PHOLIO_COMMENT = 'pholio-comment';
const TYPE_PHOLIO_UPDATED = 'pholio-updated'; const TYPE_PHOLIO_UPDATED = 'pholio-updated';