mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-20 13:52:40 +01:00
Send audit emails to more users
Summary: Audit has some weird rules about who gets email. Make them less weird: - When a user does "Add Auditors", email the auditors. - When a commit is commented on, email anyone in "concern" or "audit required" states. @staticshock, my claim that I can't reproduce was crazy, I just have weird test data and read it wrong. Test Plan: Added a user to an audit and verified they got an email. Reviewers: btrahan, chad Reviewed By: btrahan CC: staticshock, aran Differential Revision: https://secure.phabricator.com/D6414
This commit is contained in:
parent
c977168797
commit
d467c49a66
1 changed files with 16 additions and 7 deletions
|
@ -407,7 +407,7 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
|
|||
$threading = self::getMailThreading($repository, $commit);
|
||||
list($thread_id, $thread_topic) = $threading;
|
||||
|
||||
$body = $this->renderMailBody(
|
||||
$body = $this->renderMailBody(
|
||||
$comment,
|
||||
"{$name}: {$summary}",
|
||||
$handle,
|
||||
|
@ -419,7 +419,7 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
|
|||
|
||||
$author_phid = $data->getCommitDetail('authorPHID');
|
||||
if ($author_phid) {
|
||||
$email_to[] = $author_phid;
|
||||
$email_to[$author_phid] = true;
|
||||
}
|
||||
|
||||
foreach ($other_comments as $other_comment) {
|
||||
|
@ -427,13 +427,22 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
|
|||
}
|
||||
|
||||
foreach ($requests as $request) {
|
||||
if ($request->getAuditStatus() == PhabricatorAuditStatusConstants::CC) {
|
||||
$email_cc[$request->getAuditorPHID()] = true;
|
||||
} else if ($request->getAuditStatus() ==
|
||||
PhabricatorAuditStatusConstants::RESIGNED) {
|
||||
unset($email_cc[$request->getAuditorPHID()]);
|
||||
switch ($request->getAuditStatus()) {
|
||||
case PhabricatorAuditStatusConstants::CC:
|
||||
case PhabricatorAuditStatusConstants::AUDIT_REQUIRED:
|
||||
$email_cc[$request->getAuditorPHID()] = true;
|
||||
break;
|
||||
case PhabricatorAuditStatusConstants::RESIGNED:
|
||||
unset($email_cc[$request->getAuditorPHID()]);
|
||||
break;
|
||||
case PhabricatorAuditStatusConstants::CONCERNED:
|
||||
case PhabricatorAuditStatusConstants::AUDIT_REQUESTED:
|
||||
$email_to[$request->getAuditorPHID()] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$email_to = array_keys($email_to);
|
||||
$email_cc = array_keys($email_cc);
|
||||
|
||||
$phids = array_merge($email_to, $email_cc);
|
||||
|
|
Loading…
Reference in a new issue