@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 a few more email preferences for differential and maniphest

Summary: this makes notifications work better for folks who choose to handle things in Phabricator and not over email

Test Plan: had my test account and "real" account battle each other on a few tasks and divs. Noted that I received emails appropos to the respective settings.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1977

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

+76 -16
+17 -2
src/applications/differential/mail/DifferentialCommentMail.php
··· 50 50 } 51 51 52 52 protected function getMailTags() { 53 + $tags = array(); 53 54 $comment = $this->getComment(); 54 - $action = $comment->getAction(); 55 + $action = $comment->getAction(); 55 56 56 - $tags = array(); 57 57 switch ($action) { 58 58 case DifferentialAction::ACTION_ADDCCS: 59 59 $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CC; 60 60 break; 61 61 case DifferentialAction::ACTION_CLOSE: 62 62 $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED; 63 + break; 64 + case DifferentialAction::ACTION_ADDREVIEWERS: 65 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS; 66 + break; 67 + case DifferentialAction::ACTION_UPDATE: 68 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_UPDATED; 69 + break; 70 + case DifferentialAction::ACTION_REQUEST: 71 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEW_REQUEST; 72 + break; 73 + case DifferentialAction::ACTION_COMMENT: 74 + // this is a comment which we will check separately below for content 75 + break; 76 + default: 77 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER; 63 78 break; 64 79 } 65 80
+10
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 410 410 $tags = array(); 411 411 foreach ($transactions as $xaction) { 412 412 switch ($xaction->getTransactionType()) { 413 + case ManiphestTransactionType::TYPE_STATUS: 414 + $tags[] = MetaMTANotificationType::TYPE_MANIPHEST_STATUS; 415 + break; 416 + case ManiphestTransactionType::TYPE_OWNER: 417 + $tags[] = MetaMTANotificationType::TYPE_MANIPHEST_OWNER; 418 + break; 413 419 case ManiphestTransactionType::TYPE_CCS: 414 420 $tags[] = MetaMTANotificationType::TYPE_MANIPHEST_CC; 415 421 break; ··· 418 424 break; 419 425 case ManiphestTransactionType::TYPE_PRIORITY: 420 426 $tags[] = MetaMTANotificationType::TYPE_MANIPHEST_PRIORITY; 427 + break; 428 + case ManiphestTransactionType::TYPE_NONE: 429 + // this is a comment which we will check separately below for 430 + // content 421 431 break; 422 432 default: 423 433 $tags[] = MetaMTANotificationType::TYPE_MANIPHEST_OTHER;
+11 -5
src/applications/metamta/constants/MetaMTANotificationType.php
··· 19 19 final class MetaMTANotificationType 20 20 extends MetaMTAConstants { 21 21 22 - const TYPE_DIFFERENTIAL_CLOSED = 'differential-committed'; 23 - const TYPE_DIFFERENTIAL_CC = 'differential-cc'; 24 - const TYPE_DIFFERENTIAL_COMMENT = 'differential-comment'; 22 + const TYPE_DIFFERENTIAL_REVIEWERS = 'differential-reviewers'; 23 + const TYPE_DIFFERENTIAL_CLOSED = 'differential-committed'; 24 + const TYPE_DIFFERENTIAL_CC = 'differential-cc'; 25 + const TYPE_DIFFERENTIAL_COMMENT = 'differential-comment'; 26 + const TYPE_DIFFERENTIAL_UPDATED = 'differential-updated'; 27 + const TYPE_DIFFERENTIAL_REVIEW_REQUEST = 'differential-review-request'; 28 + const TYPE_DIFFERENTIAL_OTHER = 'differential-other'; 25 29 26 - const TYPE_MANIPHEST_PROJECTS = 'maniphest-projects'; 30 + const TYPE_MANIPHEST_STATUS = 'maniphest-status'; 31 + const TYPE_MANIPHEST_OWNER = 'maniphest-owner'; 27 32 const TYPE_MANIPHEST_PRIORITY = 'maniphest-priority'; 28 33 const TYPE_MANIPHEST_CC = 'maniphest-cc'; 29 - const TYPE_MANIPHEST_OTHER = 'maniphest-other'; 34 + const TYPE_MANIPHEST_PROJECTS = 'maniphest-projects'; 30 35 const TYPE_MANIPHEST_COMMENT = 'maniphest-comment'; 36 + const TYPE_MANIPHEST_OTHER = 'maniphest-other'; 31 37 32 38 }
+38 -9
src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php
··· 223 223 224 224 private function getMailTags() { 225 225 return array( 226 - MetaMTANotificationType::TYPE_DIFFERENTIAL_CC => 227 - "Send me email when a revision's CCs change.", 226 + MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS => 227 + pht("Send me email when a revision's reviewers change."), 228 228 MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED => 229 - "Send me email when a revision is closed.", 230 - MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS => 231 - "Send me email when a task's associated projects change.", 229 + pht("Send me email when a revision is closed."), 230 + MetaMTANotificationType::TYPE_DIFFERENTIAL_CC => 231 + pht("Send me email when a revision's CCs change."), 232 + MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT => 233 + pht("Send me email when a revision is commented on."), 234 + MetaMTANotificationType::TYPE_DIFFERENTIAL_UPDATED => 235 + pht("Send me email when a revision is updated."), 236 + MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEW_REQUEST => 237 + pht("Send me email when I am requested to review a revision."), 238 + MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER => 239 + pht("Send me email for any other activity not listed above."), 240 + 241 + MetaMTANotificationType::TYPE_MANIPHEST_STATUS => 242 + pht("Send me email when a task's status changes."), 243 + MetaMTANotificationType::TYPE_MANIPHEST_OWNER => 244 + pht("Send me email when a task's owner changes."), 232 245 MetaMTANotificationType::TYPE_MANIPHEST_PRIORITY => 233 - "Send me email when a task's priority changes.", 246 + pht("Send me email when a task's priority changes."), 234 247 MetaMTANotificationType::TYPE_MANIPHEST_CC => 235 - "Send me email when a task's CCs change.", 248 + pht("Send me email when a task's CCs change."), 249 + MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS => 250 + pht("Send me email when a task's associated projects change."), 251 + MetaMTANotificationType::TYPE_MANIPHEST_COMMENT => 252 + pht("Send me email when a task is commented on."), 253 + MetaMTANotificationType::TYPE_MANIPHEST_OTHER => 254 + pht("Send me email for any other activity not listed above."), 255 + 236 256 ); 237 257 } 238 258 ··· 240 260 return array_select_keys( 241 261 $this->getMailTags(), 242 262 array( 243 - MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS, 263 + MetaMTANotificationType::TYPE_MANIPHEST_STATUS, 264 + MetaMTANotificationType::TYPE_MANIPHEST_OWNER, 244 265 MetaMTANotificationType::TYPE_MANIPHEST_PRIORITY, 245 266 MetaMTANotificationType::TYPE_MANIPHEST_CC, 267 + MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS, 268 + MetaMTANotificationType::TYPE_MANIPHEST_COMMENT, 269 + MetaMTANotificationType::TYPE_MANIPHEST_OTHER, 246 270 )); 247 271 } 248 272 ··· 250 274 return array_select_keys( 251 275 $this->getMailTags(), 252 276 array( 277 + MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS, 278 + MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED, 253 279 MetaMTANotificationType::TYPE_DIFFERENTIAL_CC, 254 - MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED, 280 + MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT, 281 + MetaMTANotificationType::TYPE_DIFFERENTIAL_UPDATED, 282 + MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEW_REQUEST, 283 + MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER, 255 284 )); 256 285 } 257 286