Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / metamta / herald / PhabricatorMailMustEncryptHeraldAction.php
blob027e1bb733a540cfa1d49c92f2133debbb572327
1 <?php
3 final class PhabricatorMailMustEncryptHeraldAction
4 extends HeraldAction {
6 const DO_MUST_ENCRYPT = 'do.must-encrypt';
8 const ACTIONCONST = 'email.must-encrypt';
10 public function getHeraldActionName() {
11 return pht('Require secure email');
14 public function renderActionDescription($value) {
15 return pht(
16 'Require mail content be transmitted only over secure channels.');
18 public function supportsObject($object) {
19 return PhabricatorMetaMTAEmailHeraldAction::isMailGeneratingObject($object);
22 public function getActionGroupKey() {
23 return HeraldUtilityActionGroup::ACTIONGROUPKEY;
26 public function supportsRuleType($rule_type) {
27 return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);
30 public function getHeraldActionStandardType() {
31 return self::STANDARD_NONE;
34 public function applyEffect($object, HeraldEffect $effect) {
35 $rule_phid = $effect->getRule()->getPHID();
37 $adapter = $this->getAdapter();
38 $adapter->addMustEncryptReason($rule_phid);
40 $this->logEffect(self::DO_MUST_ENCRYPT, array($rule_phid));
43 protected function getActionEffectMap() {
44 return array(
45 self::DO_MUST_ENCRYPT => array(
46 'icon' => 'fa-shield',
47 'color' => 'blue',
48 'name' => pht('Must Encrypt'),
53 protected function renderActionEffectDescription($type, $data) {
54 switch ($type) {
55 case self::DO_MUST_ENCRYPT:
56 return pht(
57 'Made it a requirement that mail content be transmitted only '.
58 'over secure channels.');