Differential D19989 Diff 47748 src/applications/people/controller/PhabricatorPeopleNewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/controller/PhabricatorPeopleNewController.php
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
} | } | ||||
if ($is_list) { | if ($is_list) { | ||||
id(new PhabricatorUserEditor()) | id(new PhabricatorUserEditor()) | ||||
->setActor($admin) | ->setActor($admin) | ||||
->makeMailingListUser($user, true); | ->makeMailingListUser($user, true); | ||||
} | } | ||||
if ($welcome_checked && !$is_bot && !$is_list) { | if ($welcome_checked) { | ||||
$user->sendWelcomeEmail($admin); | $welcome_engine = id(new PhabricatorPeopleWelcomeMailEngine()) | ||||
->setSender($admin) | |||||
->setRecipient($user); | |||||
if ($welcome_engine->canSendMail()) { | |||||
$welcome_engine->sendMail(); | |||||
} | |||||
} | } | ||||
$response = id(new AphrontRedirectResponse()) | $response = id(new AphrontRedirectResponse()) | ||||
->setURI('/p/'.$user->getUsername().'/'); | ->setURI('/p/'.$user->getUsername().'/'); | ||||
return $response; | return $response; | ||||
} catch (AphrontDuplicateKeyQueryException $ex) { | } catch (AphrontDuplicateKeyQueryException $ex) { | ||||
$errors[] = pht('Username and email must be unique.'); | $errors[] = pht('Username and email must be unique.'); | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |