1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-19 03:01:11 +01:00

Email Preferences - round out options for Projects and Phriction

Summary: Fixes T8524, T8550. These were both missing "subscribers" and Phriction was also the only application with no "other".

Test Plan:
 - Project
   - set user A to notify only for project subscriber changes
   - made a project with user A
   - subscribed user B to project
   - verified notification sent to user A
   - used ./bin/mail to make sure no mail was sent to user A because "This mail has tags which control which users receive it, and this recipient has not elected to receive mail with any of the tags on this message (Settings > Email Preferences)."
  - Phriction
   - set user A to notify only for phriction document subscriber changes
   - made a document with user A
   - subscribed user B to document
   - verified notification sent to user A
   - used ./bin/mail to make sure no mail was sent to user A because "This mail has tags which control which users receive it, and this recipient has not elected to receive mail with any of the tags on this message (Settings > Email Preferences)."
   - observed option for "other" in email preferences

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8524, T8550

Differential Revision: https://secure.phabricator.com/D13313
This commit is contained in:
Bob Trahan 2015-06-16 14:25:13 -07:00
parent 6b7d7401ca
commit 8965c7ec9b
4 changed files with 25 additions and 8 deletions

View file

@ -391,6 +391,10 @@ final class PhrictionTransactionEditor
pht("A document's content changes."), pht("A document's content changes."),
PhrictionTransaction::MAILTAG_DELETE => PhrictionTransaction::MAILTAG_DELETE =>
pht('A document is deleted.'), pht('A document is deleted.'),
PhrictionTransaction::MAILTAG_SUBSCRIBERS =>
pht('A document\'s subscribers change.'),
PhrictionTransaction::MAILTAG_OTHER =>
pht('Other document activity not listed above occurs.'),
); );
} }

View file

@ -12,6 +12,8 @@ final class PhrictionTransaction
const MAILTAG_TITLE = 'phriction-title'; const MAILTAG_TITLE = 'phriction-title';
const MAILTAG_CONTENT = 'phriction-content'; const MAILTAG_CONTENT = 'phriction-content';
const MAILTAG_DELETE = 'phriction-delete'; const MAILTAG_DELETE = 'phriction-delete';
const MAILTAG_SUBSCRIBERS = 'phriction-subscribers';
const MAILTAG_OTHER = 'phriction-other';
public function getApplicationName() { public function getApplicationName() {
return 'phriction'; return 'phriction';
@ -280,7 +282,12 @@ final class PhrictionTransaction
case self::TYPE_DELETE: case self::TYPE_DELETE:
$tags[] = self::MAILTAG_DELETE; $tags[] = self::MAILTAG_DELETE;
break; break;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
$tags[] = self::MAILTAG_SUBSCRIBERS;
break;
default:
$tags[] = self::MAILTAG_OTHER;
break;
} }
return $tags; return $tags;
} }

View file

@ -433,6 +433,8 @@ final class PhabricatorProjectTransactionEditor
pht('Project membership changes.'), pht('Project membership changes.'),
PhabricatorProjectTransaction::MAILTAG_WATCHERS => PhabricatorProjectTransaction::MAILTAG_WATCHERS =>
pht('Project watcher list changes.'), pht('Project watcher list changes.'),
PhabricatorProjectTransaction::MAILTAG_SUBSCRIBERS =>
pht('Project subscribers change.'),
PhabricatorProjectTransaction::MAILTAG_OTHER => PhabricatorProjectTransaction::MAILTAG_OTHER =>
pht('Other project activity not listed above occurs.'), pht('Other project activity not listed above occurs.'),
); );

View file

@ -16,6 +16,7 @@ final class PhabricatorProjectTransaction
const MAILTAG_METADATA = 'project-metadata'; const MAILTAG_METADATA = 'project-metadata';
const MAILTAG_MEMBERS = 'project-members'; const MAILTAG_MEMBERS = 'project-members';
const MAILTAG_SUBSCRIBERS = 'project-subscribers';
const MAILTAG_WATCHERS = 'project-watchers'; const MAILTAG_WATCHERS = 'project-watchers';
const MAILTAG_OTHER = 'project-other'; const MAILTAG_OTHER = 'project-other';
@ -369,6 +370,9 @@ final class PhabricatorProjectTransaction
case self::TYPE_COLOR: case self::TYPE_COLOR:
$tags[] = self::MAILTAG_METADATA; $tags[] = self::MAILTAG_METADATA;
break; break;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
$tags[] = self::MAILTAG_SUBSCRIBERS;
break;
case PhabricatorTransactions::TYPE_EDGE: case PhabricatorTransactions::TYPE_EDGE:
$type = $this->getMetadata('edge:type'); $type = $this->getMetadata('edge:type');
$type = head($type); $type = head($type);