mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
Add repository to audit emails
Summary: This is vaguely related to T5791. Add a "REPOSITORY" header to audit emails so that they can be filtered in Gmail. Test Plan: Commented on an audit and used `./bin/mail show-outbound` to inspect outbound email. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: fabe, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12997
This commit is contained in:
parent
6079629038
commit
be19b31a64
3 changed files with 38 additions and 4 deletions
|
@ -1542,6 +1542,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorCommitBranchesField' => 'applications/repository/customfield/PhabricatorCommitBranchesField.php',
|
||||
'PhabricatorCommitCustomField' => 'applications/repository/customfield/PhabricatorCommitCustomField.php',
|
||||
'PhabricatorCommitMergedCommitsField' => 'applications/repository/customfield/PhabricatorCommitMergedCommitsField.php',
|
||||
'PhabricatorCommitRepositoryField' => 'applications/repository/customfield/PhabricatorCommitRepositoryField.php',
|
||||
'PhabricatorCommitSearchEngine' => 'applications/audit/query/PhabricatorCommitSearchEngine.php',
|
||||
'PhabricatorCommitTagsField' => 'applications/repository/customfield/PhabricatorCommitTagsField.php',
|
||||
'PhabricatorCommonPasswords' => 'applications/auth/constants/PhabricatorCommonPasswords.php',
|
||||
|
@ -4908,6 +4909,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorCommitBranchesField' => 'PhabricatorCommitCustomField',
|
||||
'PhabricatorCommitCustomField' => 'PhabricatorCustomField',
|
||||
'PhabricatorCommitMergedCommitsField' => 'PhabricatorCommitCustomField',
|
||||
'PhabricatorCommitRepositoryField' => 'PhabricatorCommitCustomField',
|
||||
'PhabricatorCommitSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhabricatorCommitTagsField' => 'PhabricatorCommitCustomField',
|
||||
'PhabricatorCommonPasswords' => 'Phobject',
|
||||
|
|
|
@ -23,6 +23,7 @@ final class PhabricatorDiffusionConfigOptions
|
|||
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
|
||||
|
||||
$fields = array(
|
||||
new PhabricatorCommitRepositoryField(),
|
||||
new PhabricatorCommitBranchesField(),
|
||||
new PhabricatorCommitTagsField(),
|
||||
new PhabricatorCommitMergedCommitsField(),
|
||||
|
@ -143,7 +144,8 @@ final class PhabricatorDiffusionConfigOptions
|
|||
->setCustomData(
|
||||
id(new PhabricatorRepositoryCommit())
|
||||
->getCustomFieldBaseClass())
|
||||
->setDescription(pht(
|
||||
->setDescription(
|
||||
pht(
|
||||
"Select and reorder diffusion fields.\n\n".
|
||||
"These will primarily show up in Mail Notifications.")),
|
||||
);
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorCommitRepositoryField
|
||||
extends PhabricatorCommitCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'diffusion:repository';
|
||||
}
|
||||
|
||||
public function shouldDisableByDefault() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldAppearInTransactionMail() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function updateTransactionMailBody(
|
||||
PhabricatorMetaMTAMailBody $body,
|
||||
PhabricatorApplicationTransactionEditor $editor,
|
||||
array $xactions) {
|
||||
|
||||
$repository = $this->getObject()->getRepository();
|
||||
|
||||
$body->addTextSection(
|
||||
pht('REPOSITORY'),
|
||||
$repository->getMonogram().' '.$repository->getName());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue