optionally send welcome email in installforemail.php

This commit is contained in:
Evan Prodromou 2011-05-04 11:10:21 -07:00
parent 914de296a1
commit b432cc72c9
1 changed files with 11 additions and 0 deletions

View File

@ -22,8 +22,15 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$shortoptions = 'w';
$longoptions = array('welcome');
$helptext = <<<END_OF_INSTALLFOREMAIL_HELP
installforemail.php [options] <email address>
Create a new account and, if necessary, a new network for the given email address
-w --welcome Send a welcome email
END_OF_INSTALLFOREMAIL_HELP;
@ -54,6 +61,10 @@ StatusNet::switchSite($sn->nickname);
$confirm = EmailRegistrationPlugin::registerEmail($email);
if (have_option('w', 'welcome')) {
EmailRegistrationPlugin::sendConfirmEmail($confirm);
}
$confirmUrl = common_local_url('register', array('code' => $confirm->code));
print $confirmUrl."\n";