mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +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) {
|
||||
$users = array();
|
||||
$xusrs = array();
|
||||
$mlsts = array();
|
||||
// first iteration - group by types to do data fetches
|
||||
foreach ($phids as $phid => $type) {
|
||||
|
@ -694,11 +695,15 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
|||
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
||||
$users[] = $phid;
|
||||
break;
|
||||
case PhabricatorPHIDConstants::PHID_TYPE_XUSR:
|
||||
$xusrs[] = $phid;
|
||||
break;
|
||||
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
||||
$mlsts[] = $phid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$user_emails = array();
|
||||
if ($users) {
|
||||
$user_emails = id(new PhabricatorUserEmail())->loadAllWhere(
|
||||
|
@ -708,6 +713,13 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
|||
$user_emails = mpull($user_emails, null, 'getUserPHID');
|
||||
$users = mpull($users, null, 'getPHID');
|
||||
}
|
||||
|
||||
if ($xusrs) {
|
||||
$xusrs = id(new PhabricatorExternalAccount())->loadAllWhere(
|
||||
'phid IN (%Ls)', $xusrs);
|
||||
$xusrs = mpull($xusrs, null, 'getPHID');
|
||||
}
|
||||
|
||||
if ($mlsts) {
|
||||
$mlsts = id(new PhabricatorMetaMTAMailingList())->loadAllWhere(
|
||||
'phid IN (%Ls)', $mlsts);
|
||||
|
@ -732,6 +744,17 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
|||
$user_emails[$phid]->getAddress() :
|
||||
$default;
|
||||
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:
|
||||
$mlst = $mlsts[$phid];
|
||||
if ($mlst) {
|
||||
|
|
Loading…
Reference in a new issue