]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/EmailRegistration/scripts/registeremailuser.php
Move business logic of email registration to plugin
[quix0rs-gnu-social.git] / plugins / EmailRegistration / scripts / registeremailuser.php
index 1807fd7f9a59d0532cbfc6ab6ba8ea885c5ee466..a8c942d3dd9d5f52c92464d233b2be1a9f4db24b 100644 (file)
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
 
 $helptext = <<<END_OF_REGISTEREMAILUSER_HELP
-registeremailuser.php [options] <email>
+registeremailuser.php [options] <email address>
+
+Options:
+-e --email     Send a confirmation message to the email address
+
 register a new user by email address.
 
 END_OF_REGISTEREMAILUSER_HELP;
@@ -35,6 +39,11 @@ if (count($args) == 0) {
 $email = $args[0];
 
 $confirm = EmailRegistrationPlugin::registerEmail($email);
+
+if (have_option('e', 'email')) {
+    EmailRegistrationPlugin::sendConfirmEmail($confirm);
+}
+
 $confirmUrl = common_local_url('register', array('code' => $confirm->code));
 
 print $confirmUrl."\n";