Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | final class PhabricatorMetaMTAMail | ||||
public function getMailStampMetadata() { | public function getMailStampMetadata() { | ||||
return $this->getParam('stampMetadata', array()); | return $this->getParam('stampMetadata', array()); | ||||
} | } | ||||
public function getMailerKey() { | public function getMailerKey() { | ||||
return $this->getParam('mailer.key'); | return $this->getParam('mailer.key'); | ||||
} | } | ||||
public function setTryMailers(array $mailers) { | |||||
return $this->setParam('mailers.try', $mailers); | |||||
} | |||||
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 134 Lines • ▼ Show 20 Lines | final class PhabricatorMetaMTAMail | ||||
*/ | */ | ||||
public function sendNow() { | public function sendNow() { | ||||
if ($this->getStatus() != PhabricatorMailOutboundStatus::STATUS_QUEUE) { | if ($this->getStatus() != PhabricatorMailOutboundStatus::STATUS_QUEUE) { | ||||
throw new Exception(pht('Trying to send an already-sent mail!')); | throw new Exception(pht('Trying to send an already-sent mail!')); | ||||
} | } | ||||
$mailers = self::newMailers(); | $mailers = self::newMailers(); | ||||
$try_mailers = $this->getParam('mailers.try'); | |||||
if ($try_mailers) { | |||||
$mailers = mpull($mailers, null, 'getKey'); | |||||
$mailers = array_select_keys($mailers, $try_mailers); | |||||
} | |||||
return $this->sendWithMailers($mailers); | return $this->sendWithMailers($mailers); | ||||
} | } | ||||
public static function newMailers() { | public static function newMailers() { | ||||
$mailers = array(); | $mailers = array(); | ||||
$config = PhabricatorEnv::getEnvConfig('cluster.mailers'); | $config = PhabricatorEnv::getEnvConfig('cluster.mailers'); | ||||
if ($config === null) { | if ($config === null) { | ||||
▲ Show 20 Lines • Show All 1,012 Lines • Show Last 20 Lines |