Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/data/PhabricatorAuthInviteAction.php
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | foreach ($results as $result) { | ||||
if (!$result->action) { | if (!$result->action) { | ||||
$result->action = self::ACTION_SEND; | $result->action = self::ACTION_SEND; | ||||
} | } | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
public function sendInvite(PhabricatorUser $actor, $template) { | |||||
if (!$this->willSend()) { | |||||
throw new Exception(pht('Invite action is not a send action!')); | |||||
} | |||||
if (!preg_match('/{\$INVITE_URI}/', $template)) { | |||||
throw new Exception(pht('Invite template does not include invite URI!')); | |||||
} | |||||
PhabricatorWorker::scheduleTask( | |||||
'PhabricatorAuthInviteWorker', | |||||
array( | |||||
'address' => $this->getEmailAddress(), | |||||
'template' => $template, | |||||
'authorPHID' => $actor->getPHID(), | |||||
)); | |||||
} | |||||
} | } |