mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Enabling Maniphest to send email to External Users.
Summary: Maniphest sends email to External users. Test Plan: {F42649} It seems that maniphest tries to send an email, my install is not configured to deliver email. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, AnhNhan Maniphest Tasks: T1205 Differential Revision: https://secure.phabricator.com/D5856
This commit is contained in:
parent
e7fde9a77c
commit
6cd4a564dc
1 changed files with 23 additions and 0 deletions
|
@ -687,6 +687,7 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
|
|
||||||
private function loadEmailAndNameDataFromPHIDs(array &$phids) {
|
private function loadEmailAndNameDataFromPHIDs(array &$phids) {
|
||||||
$users = array();
|
$users = array();
|
||||||
|
$xusrs = array();
|
||||||
$mlsts = array();
|
$mlsts = array();
|
||||||
// first iteration - group by types to do data fetches
|
// first iteration - group by types to do data fetches
|
||||||
foreach ($phids as $phid => $type) {
|
foreach ($phids as $phid => $type) {
|
||||||
|
@ -694,11 +695,15 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
||||||
$users[] = $phid;
|
$users[] = $phid;
|
||||||
break;
|
break;
|
||||||
|
case PhabricatorPHIDConstants::PHID_TYPE_XUSR:
|
||||||
|
$xusrs[] = $phid;
|
||||||
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
||||||
$mlsts[] = $phid;
|
$mlsts[] = $phid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_emails = array();
|
$user_emails = array();
|
||||||
if ($users) {
|
if ($users) {
|
||||||
$user_emails = id(new PhabricatorUserEmail())->loadAllWhere(
|
$user_emails = id(new PhabricatorUserEmail())->loadAllWhere(
|
||||||
|
@ -708,6 +713,13 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
$user_emails = mpull($user_emails, null, 'getUserPHID');
|
$user_emails = mpull($user_emails, null, 'getUserPHID');
|
||||||
$users = mpull($users, null, 'getPHID');
|
$users = mpull($users, null, 'getPHID');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($xusrs) {
|
||||||
|
$xusrs = id(new PhabricatorExternalAccount())->loadAllWhere(
|
||||||
|
'phid IN (%Ls)', $xusrs);
|
||||||
|
$xusrs = mpull($xusrs, null, 'getPHID');
|
||||||
|
}
|
||||||
|
|
||||||
if ($mlsts) {
|
if ($mlsts) {
|
||||||
$mlsts = id(new PhabricatorMetaMTAMailingList())->loadAllWhere(
|
$mlsts = id(new PhabricatorMetaMTAMailingList())->loadAllWhere(
|
||||||
'phid IN (%Ls)', $mlsts);
|
'phid IN (%Ls)', $mlsts);
|
||||||
|
@ -732,6 +744,17 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
$user_emails[$phid]->getAddress() :
|
$user_emails[$phid]->getAddress() :
|
||||||
$default;
|
$default;
|
||||||
break;
|
break;
|
||||||
|
case PhabricatorPHIDConstants::PHID_TYPE_XUSR:
|
||||||
|
$xusr = $xusrs[$phid];
|
||||||
|
if ($xusr) {
|
||||||
|
$name = $xusr->getDisplayName();
|
||||||
|
$email = $xusr->getAccountID();
|
||||||
|
$accountType = $xusr->getAccountType();
|
||||||
|
if ($accountType == 'email') {
|
||||||
|
$is_mailable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
||||||
$mlst = $mlsts[$phid];
|
$mlst = $mlsts[$phid];
|
||||||
if ($mlst) {
|
if ($mlst) {
|
||||||
|
|
Loading…
Reference in a new issue