Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/engine/PhabricatorMailEmailEngine.php
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | public function newMessage() { | ||||
$message->setHeaders($filtered_headers); | $message->setHeaders($filtered_headers); | ||||
$mail->setUnfilteredHeaders($headers); | $mail->setUnfilteredHeaders($headers); | ||||
$mail->setDeliveredHeaders($headers); | $mail->setDeliveredHeaders($headers); | ||||
if (PhabricatorEnv::getEnvConfig('phabricator.silent')) { | if (PhabricatorEnv::getEnvConfig('phabricator.silent')) { | ||||
$mail->setMessage( | $mail->setMessage( | ||||
pht( | pht( | ||||
'Phabricator is running in silent mode. See `%s` '. | '%s is running in silent mode. See `%s` '. | ||||
'in the configuration to change this setting.', | 'in the configuration to change this setting.', | ||||
PhabricatorPlatformSite::getName(), | |||||
'phabricator.silent')); | 'phabricator.silent')); | ||||
return null; | return null; | ||||
} | } | ||||
return $message; | return $message; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | private function newReplyToEmailAddress() { | ||||
$from_phid = $mail->getFrom(); | $from_phid = $mail->getFrom(); | ||||
$actor = $this->getActor($from_phid); | $actor = $this->getActor($from_phid); | ||||
if ($actor) { | if ($actor) { | ||||
$reply_address->setDisplayName($actor->getName()); | $reply_address->setDisplayName($actor->getName()); | ||||
} | } | ||||
// If we don't have a display name, fill in a default. | // If we don't have a display name, fill in a default. | ||||
if (!strlen($reply_address->getDisplayName())) { | if (!strlen($reply_address->getDisplayName())) { | ||||
$reply_address->setDisplayName(pht('Phabricator')); | $reply_address->setDisplayName( | ||||
pht('%s', PhabricatorPlatformSite::getName())); | |||||
} | } | ||||
return $reply_address; | return $reply_address; | ||||
} | } | ||||
private function newToEmailAddresses() { | private function newToEmailAddresses() { | ||||
$mail = $this->getMail(); | $mail = $this->getMail(); | ||||
▲ Show 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | public function newDefaultEmailAddress() { | ||||
if (!strlen($raw_address)) { | if (!strlen($raw_address)) { | ||||
$domain = $this->newMailDomain(); | $domain = $this->newMailDomain(); | ||||
$raw_address = "noreply@{$domain}"; | $raw_address = "noreply@{$domain}"; | ||||
} | } | ||||
$address = new PhutilEmailAddress($raw_address); | $address = new PhutilEmailAddress($raw_address); | ||||
if (!strlen($address->getDisplayName())) { | if (!strlen($address->getDisplayName())) { | ||||
$address->setDisplayName(pht('Phabricator')); | $address->setDisplayName( | ||||
pht('%s', PhabricatorPlatformSite::getName())); | |||||
} | } | ||||
return $address; | return $address; | ||||
} | } | ||||
public function newVoidEmailAddress() { | public function newVoidEmailAddress() { | ||||
return $this->newDefaultEmailAddress(); | return $this->newDefaultEmailAddress(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0