I think this improves email a good deal, although it's hard to really test it
since Exchange has been down for like 30 minutes now. Push & Pray! Summary: Test Plan: Reviewers: CC:
This commit is contained in:
@@ -69,7 +69,6 @@ class PhabricatorEmailLoginController extends PhabricatorAuthController {
|
||||
array(
|
||||
$target_user->getPHID(),
|
||||
));
|
||||
$mail->setReplyTo(PhabricatorEnv::getEnvConfig('metamta.noreply'));
|
||||
$mail->setBody(
|
||||
"blah blah blah ".
|
||||
PhabricatorEnv::getURI('/login/etoken/'.$etoken.'/').'?email='.phutil_escape_uri($target_user->getEmail()));
|
||||
|
||||
@@ -73,11 +73,16 @@ abstract class DifferentialMail {
|
||||
|
||||
$mail = new PhabricatorMetaMTAMail();
|
||||
$handle = $this->getActorHandle();
|
||||
$reply = $this->getReplyHandlerEmailAddress();
|
||||
if ($handle) {
|
||||
$mail->setFrom($handle->getPHID());
|
||||
$mail->setReplyTo($this->getReplyHandlerEmailAddress());
|
||||
if ($reply) {
|
||||
$mail->setReplyTo($this->getReplyHandlerEmailAddress());
|
||||
}
|
||||
} else {
|
||||
$mail->setFrom($this->getReplyHandlerEmailAddress());
|
||||
if ($reply) {
|
||||
$mail->setFrom($this->getReplyHandlerEmailAddress());
|
||||
}
|
||||
}
|
||||
|
||||
$mail
|
||||
@@ -144,6 +149,7 @@ EOTEXT;
|
||||
}
|
||||
|
||||
protected function getReplyHandlerEmailAddress() {
|
||||
return null;
|
||||
// TODO
|
||||
$phid = $this->getRevision()->getPHID();
|
||||
$server = 'todo.example.com';
|
||||
|
||||
@@ -166,8 +166,21 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||
|
||||
$handles = id(new PhabricatorObjectHandleData($phids))
|
||||
->loadHandles();
|
||||
|
||||
$params = $this->parameters;
|
||||
$default = PhabricatorEnv::getEnvConfig('metamta.default-address');
|
||||
if (empty($params['from'])) {
|
||||
$mailer->setFrom($default);
|
||||
} else if (!PhabricatorEnv::getEnvConfig('metamta.can-send-as-user')) {
|
||||
$from = $params['from'];
|
||||
if (empty($params['reply-to'])) {
|
||||
$params['reply-to'] = $handles[$from]->getEmail();
|
||||
}
|
||||
$mailer->setFrom($default);
|
||||
unset($params['from']);
|
||||
}
|
||||
|
||||
foreach ($this->parameters as $key => $value) {
|
||||
foreach ($params as $key => $value) {
|
||||
switch ($key) {
|
||||
case 'from':
|
||||
$mailer->setFrom($handles[$value]->getEmail());
|
||||
|
||||
Reference in New Issue
Block a user