Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15284954
D19991.id47725.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D19991.id47725.diff
View Options
diff --git a/src/applications/people/controller/PhabricatorPeopleProfileManageController.php b/src/applications/people/controller/PhabricatorPeopleProfileManageController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileManageController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileManageController.php
@@ -155,6 +155,18 @@
$disable_name = pht('Disable User');
}
+ $curtain->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-envelope')
+ ->setName(pht('Send Welcome Email'))
+ ->setWorkflow(true)
+ ->setDisabled(!$can_welcome)
+ ->setHref($this->getApplicationURI('welcome/'.$user->getID().'/')));
+
+ $curtain->addAction(
+ id(new PhabricatorActionView())
+ ->setType(PhabricatorActionView::TYPE_DIVIDER));
+
$curtain->addAction(
id(new PhabricatorActionView())
->setIcon($disable_icon)
@@ -173,11 +185,7 @@
$curtain->addAction(
id(new PhabricatorActionView())
- ->setIcon('fa-envelope')
- ->setName(pht('Send Welcome Email'))
- ->setWorkflow(true)
- ->setDisabled(!$can_welcome)
- ->setHref($this->getApplicationURI('welcome/'.$user->getID().'/')));
+ ->setType(PhabricatorActionView::TYPE_DIVIDER));
return $curtain;
}
diff --git a/src/applications/people/controller/PhabricatorPeopleWelcomeController.php b/src/applications/people/controller/PhabricatorPeopleWelcomeController.php
--- a/src/applications/people/controller/PhabricatorPeopleWelcomeController.php
+++ b/src/applications/people/controller/PhabricatorPeopleWelcomeController.php
@@ -37,24 +37,45 @@
->addCancelButton($profile_uri, pht('Done'));
}
+ $v_message = $request->getStr('message');
+
if ($request->isFormPost()) {
+ if (strlen($v_message)) {
+ $welcome_engine->setWelcomeMessage($v_message);
+ }
+
$welcome_engine->sendMail();
return id(new AphrontRedirectResponse())->setURI($profile_uri);
}
- return $this->newDialog()
- ->setTitle(pht('Send Welcome Email'))
- ->appendParagraph(
+ $form = id(new AphrontFormView())
+ ->setViewer($admin)
+ ->appendInstructions(
pht(
- 'This will send the user another 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 '.
- 'accounts are created.'))
- ->appendParagraph(
+ 'accounts are created by an administrator.',
+ $user->getUsername()))
+ ->appendInstructions(
pht(
- 'The email contains a link to log in to their account. Sending '.
- 'another copy of the email can be useful if the original was lost '.
- 'or never sent.'))
- ->appendParagraph(pht('The email will identify you as the sender.'))
+ 'The email will contain a link that the user may use to log in '.
+ 'to their account. This link bypasses authentication requirements '.
+ '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.'))
+ ->appendInstructions(
+ pht(
+ 'The email will identify you as the sender. You may optionally '.
+ 'include additional text in the mail body by specifying it below.'))
+ ->appendControl(
+ id(new AphrontFormTextAreaControl())
+ ->setName('message')
+ ->setLabel(pht('Custom Message'))
+ ->setValue($v_message));
+
+ return $this->newDialog()
+ ->setTitle(pht('Send Welcome Email'))
+ ->setWidth(AphrontDialogView::WIDTH_FORM)
+ ->appendForm($form)
->addSubmitButton(pht('Send Email'))
->addCancelButton($profile_uri);
}
diff --git a/src/applications/people/mail/PhabricatorPeopleWelcomeMailEngine.php b/src/applications/people/mail/PhabricatorPeopleWelcomeMailEngine.php
--- a/src/applications/people/mail/PhabricatorPeopleWelcomeMailEngine.php
+++ b/src/applications/people/mail/PhabricatorPeopleWelcomeMailEngine.php
@@ -3,6 +3,17 @@
final class PhabricatorPeopleWelcomeMailEngine
extends PhabricatorPeopleMailEngine {
+ private $welcomeMessage;
+
+ public function setWelcomeMessage($welcome_message) {
+ $this->welcomeMessage = $welcome_message;
+ return $this;
+ }
+
+ public function getWelcomeMessage() {
+ return $this->welcomeMessage;
+ }
+
public function validateMail() {
$sender = $this->getSender();
$recipient = $this->getRecipient();
@@ -88,8 +99,13 @@
$message[] = pht(' %s', $base_uri);
}
- if (!$is_serious) {
- $message[] = pht("Love,\nPhabricator");
+ $custom_body = $this->getWelcomeMessage();
+ if (strlen($custom_body)) {
+ $message[] = $custom_body;
+ } else {
+ if (!$is_serious) {
+ $message[] = pht("Love,\nPhabricator");
+ }
}
$message = implode("\n\n", $message);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 5, 11:04 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225262
Default Alt Text
D19991.id47725.diff (4 KB)
Attached To
Mode
D19991: Allow administrators to provide custom welcome text when welcoming users on the profile workflow
Attached
Detach File
Event Timeline
Log In to Comment