mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Remove defunct "metamta.herald.show-hints" Config option
Summary: Ref T13216. See PHI985. This config option once controlled adding a Herald transcript link to email. However, this was never implemented in a generic way and was removed from revisions in D8459 and from commits in D10705. No one has noticed or asked for this option for several years, so this is probably a good opportunity to simplify the software and reduce the total amount of configuration. If we did want to pursue this in the future, I'd generally prefer to make it part of the mail detail page (`/mail/detail/12345/`) anyway. Test Plan: Grepped for `metamta.herald.show-hints` and `addHeraldSection()`, got no hits for either. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13216 Differential Revision: https://secure.phabricator.com/D19833
This commit is contained in:
parent
9473f60a36
commit
5343b1f898
3 changed files with 2 additions and 57 deletions
|
@ -81,14 +81,6 @@ of each approach are:
|
|||
- Required if private reply-to addresses are configured.
|
||||
- Mail messages are sent in the language of user preference.
|
||||
|
||||
EODOC
|
||||
));
|
||||
|
||||
$herald_hints_description = $this->deformat(pht(<<<EODOC
|
||||
You can disable the Herald hints in email if users prefer smaller messages.
|
||||
These are the links under the header "WHY DID I GET THIS EMAIL?". If you set
|
||||
this to `false`, they will not appear in any mail. Users can still navigate to
|
||||
the links via the web interface.
|
||||
EODOC
|
||||
));
|
||||
|
||||
|
@ -256,14 +248,6 @@ EODOC
|
|||
->setLocked(true)
|
||||
->setDescription(pht('Domain used for reply email addresses.'))
|
||||
->addExample('phabricator.example.com', ''),
|
||||
$this->newOption('metamta.herald.show-hints', 'bool', true)
|
||||
->setBoolOptions(
|
||||
array(
|
||||
pht('Show Herald Hints'),
|
||||
pht('No Herald Hints'),
|
||||
))
|
||||
->setSummary(pht('Show hints about Herald rules in email.'))
|
||||
->setDescription($herald_hints_description),
|
||||
$this->newOption('metamta.recipients.show-hints', 'bool', true)
|
||||
->setBoolOptions(
|
||||
array(
|
||||
|
|
|
@ -151,24 +151,6 @@ final class PhabricatorMetaMTAMailBody extends Phobject {
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Herald section with a rule management URI and a transcript URI.
|
||||
*
|
||||
* @param string URI to rule transcripts.
|
||||
* @return this
|
||||
* @task compose
|
||||
*/
|
||||
public function addHeraldSection($xscript_uri) {
|
||||
if (!PhabricatorEnv::getEnvConfig('metamta.herald.show-hints')) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->addLinkSection(
|
||||
pht('WHY DID I GET THIS EMAIL?'),
|
||||
PhabricatorEnv::getProductionURI($xscript_uri));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an attachment.
|
||||
|
|
|
@ -10,36 +10,15 @@ HEADER
|
|||
bass
|
||||
trout
|
||||
|
||||
WHY DID I GET THIS EMAIL?
|
||||
http://test.com/xscript/
|
||||
|
||||
EOTEXT;
|
||||
|
||||
$this->assertEmail($expect, true);
|
||||
$this->assertEmail($expect);
|
||||
}
|
||||
|
||||
public function testBodyRenderNoHerald() {
|
||||
$expect = <<<EOTEXT
|
||||
salmon
|
||||
|
||||
HEADER
|
||||
bass
|
||||
trout
|
||||
|
||||
EOTEXT;
|
||||
|
||||
$this->assertEmail($expect, false);
|
||||
}
|
||||
|
||||
private function assertEmail($expect, $herald_hints) {
|
||||
$env = PhabricatorEnv::beginScopedEnv();
|
||||
$env->overrideEnvConfig('phabricator.production-uri', 'http://test.com/');
|
||||
$env->overrideEnvConfig('metamta.herald.show-hints', $herald_hints);
|
||||
|
||||
private function assertEmail($expect) {
|
||||
$body = new PhabricatorMetaMTAMailBody();
|
||||
$body->addRawSection('salmon');
|
||||
$body->addTextSection('HEADER', "bass\ntrout\n");
|
||||
$body->addHeraldSection('/xscript/');
|
||||
|
||||
$this->assertEqual($expect, $body->render());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue