Differential D19995 Diff 47735 src/applications/people/controller/PhabricatorPeopleWelcomeController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/controller/PhabricatorPeopleWelcomeController.php
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| if (strlen($v_message)) { | if (strlen($v_message)) { | ||||
| $welcome_engine->setWelcomeMessage($v_message); | $welcome_engine->setWelcomeMessage($v_message); | ||||
| } | } | ||||
| $welcome_engine->sendMail(); | $welcome_engine->sendMail(); | ||||
| return id(new AphrontRedirectResponse())->setURI($profile_uri); | return id(new AphrontRedirectResponse())->setURI($profile_uri); | ||||
| } | } | ||||
| $default_message = PhabricatorAuthMessage::loadMessage( | |||||
avivey: `$default_message` may return null under some case - maybe any fresh install/upgrade? Is there… | |||||
Not Done Inline ActionsFixed by D20001. amckinley: Fixed by D20001. | |||||
| $admin, | |||||
| PhabricatorAuthWelcomeMailMessageType::MESSAGEKEY); | |||||
| if (strlen($default_message->getMessageText())) { | |||||
| $message_instructions = pht( | |||||
| 'The email will identify you as the sender. You may optionally '. | |||||
| 'replace the [[ %s | default custom mail body ]] with different text '. | |||||
| 'by providing a message below.', | |||||
| $default_message->getURI()); | |||||
| } else { | |||||
| $message_instructions = pht( | |||||
| 'The email will identify you as the sender. You may optionally '. | |||||
| 'include additional text in the mail body by specifying it below.'); | |||||
| } | |||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setViewer($admin) | ->setViewer($admin) | ||||
| ->appendInstructions( | ->appendRemarkupInstructions( | ||||
| pht( | pht( | ||||
| 'This workflow will send this user ("%s") a copy of the "Welcome to '. | 'This workflow will send this user ("%s") a copy of the "Welcome to '. | ||||
| 'Phabricator" email that users normally receive when their '. | 'Phabricator" email that users normally receive when their '. | ||||
| 'accounts are created by an administrator.', | 'accounts are created by an administrator.', | ||||
| $user->getUsername())) | $user->getUsername())) | ||||
| ->appendInstructions( | ->appendRemarkupInstructions( | ||||
| pht( | pht( | ||||
| 'The email will contain a link that the user may use to log in '. | 'The email will contain a link that the user may use to log in '. | ||||
| 'to their account. This link bypasses authentication requirements '. | 'to their account. This link bypasses authentication requirements '. | ||||
| 'and allows them to log in without credentials. Sending a copy of '. | 'and allows them to log in without credentials. Sending a copy of '. | ||||
| 'this email can be useful if the original was lost or never sent.')) | 'this email can be useful if the original was lost or never sent.')) | ||||
| ->appendInstructions( | ->appendRemarkupInstructions($message_instructions) | ||||
| pht( | |||||
| 'The email will identify you as the sender. You may optionally '. | |||||
| 'include additional text in the mail body by specifying it below.')) | |||||
| ->appendControl( | ->appendControl( | ||||
| id(new AphrontFormTextAreaControl()) | id(new PhabricatorRemarkupControl()) | ||||
| ->setName('message') | ->setName('message') | ||||
| ->setLabel(pht('Custom Message')) | ->setLabel(pht('Custom Message')) | ||||
| ->setValue($v_message)); | ->setValue($v_message)); | ||||
| return $this->newDialog() | return $this->newDialog() | ||||
| ->setTitle(pht('Send Welcome Email')) | ->setTitle(pht('Send Welcome Email')) | ||||
| ->setWidth(AphrontDialogView::WIDTH_FORM) | ->setWidth(AphrontDialogView::WIDTH_FORM) | ||||
| ->appendForm($form) | ->appendForm($form) | ||||
| ->addSubmitButton(pht('Send Email')) | ->addSubmitButton(pht('Send Email')) | ||||
| ->addCancelButton($profile_uri); | ->addCancelButton($profile_uri); | ||||
| } | } | ||||
| } | } | ||||
$default_message may return null under some case - maybe any fresh install/upgrade? Is there a default-default value?