Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
| Show First 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | public function setMustEncryptReasons(array $reasons) { | ||||
| $this->setParam('mustEncryptReasons', $reasons); | $this->setParam('mustEncryptReasons', $reasons); | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getMustEncryptReasons() { | public function getMustEncryptReasons() { | ||||
| return $this->getParam('mustEncryptReasons', array()); | return $this->getParam('mustEncryptReasons', array()); | ||||
| } | } | ||||
| public function setMailStamps(array $stamps) { | |||||
| return $this->setParam('stamps', $stamps); | |||||
| } | |||||
| public function getMailStamps() { | |||||
| return $this->getParam('stamps', array()); | |||||
| } | |||||
| public function setMailStampMetadata($metadata) { | |||||
| return $this->setParam('stampMetadata', $metadata); | |||||
| } | |||||
| public function getMailStampMetadata() { | |||||
| return $this->getParam('stampMetadata', array()); | |||||
| } | |||||
| public function setHTMLBody($html) { | public function setHTMLBody($html) { | ||||
| $this->setParam('html-body', $html); | $this->setParam('html-body', $html); | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getBody() { | public function getBody() { | ||||
| return $this->getParam('body'); | return $this->getParam('body'); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 322 Lines • ▼ Show 20 Lines | try { | ||||
| break; | break; | ||||
| default: | default: | ||||
| // Other parameters are handled elsewhere or are not relevant to | // Other parameters are handled elsewhere or are not relevant to | ||||
| // constructing the message. | // constructing the message. | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| $stamps = $this->getMailStamps(); | |||||
| if ($stamps) { | |||||
| $headers[] = array('X-Phabricator-Stamps', implode(', ', $stamps)); | |||||
| } | |||||
| $raw_body = idx($params, 'body', ''); | $raw_body = idx($params, 'body', ''); | ||||
| $body = $raw_body; | $body = $raw_body; | ||||
| if ($must_encrypt) { | if ($must_encrypt) { | ||||
| $parts = array(); | $parts = array(); | ||||
| $parts[] = pht( | $parts[] = pht( | ||||
| 'The content for this message can only be transmitted over a '. | 'The content for this message can only be transmitted over a '. | ||||
| 'secure channel. To view the message content, follow this '. | 'secure channel. To view the message content, follow this '. | ||||
| 'link:'); | 'link:'); | ||||
| ▲ Show 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | /* -( Preferences )-------------------------------------------------------- */ | ||||
| private function shouldSendHTML(PhabricatorUserPreferences $preferences) { | private function shouldSendHTML(PhabricatorUserPreferences $preferences) { | ||||
| $value = $preferences->getSettingValue( | $value = $preferences->getSettingValue( | ||||
| PhabricatorEmailFormatSetting::SETTINGKEY); | PhabricatorEmailFormatSetting::SETTINGKEY); | ||||
| return ($value == PhabricatorEmailFormatSetting::VALUE_HTML_EMAIL); | return ($value == PhabricatorEmailFormatSetting::VALUE_HTML_EMAIL); | ||||
| } | } | ||||
| public function shouldRenderMailStampsInBody($viewer) { | |||||
| $preferences = $this->loadPreferences($viewer->getPHID()); | |||||
| $value = $preferences->getSettingValue( | |||||
| PhabricatorEmailStampsSetting::SETTINGKEY); | |||||
| return ($value == PhabricatorEmailStampsSetting::VALUE_BODY_STAMPS); | |||||
| } | |||||
| /* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getCapabilities() { | public function getCapabilities() { | ||||
| return array( | return array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| ); | ); | ||||
| Show All 32 Lines | |||||