#!/usr/bin/env php . */ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); $shortoptions = 'wt::'; $longoptions = array('welcome', 'template='); $helptext = << Create a new account and, if necessary, a new network for the given email address -w --welcome Send a welcome email -t --template= Use this email template END_OF_INSTALLFOREMAIL_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; $email = $args[0]; $sendWelcome = have_option('w', 'welcome'); if ($sendWelcome && have_option('t', 'template')) { $template = get_option_value('t', 'template'); } try { $confirm = DomainStatusNetworkPlugin::registerEmail($email); if ($sendWelcome) { EmailRegistrationPlugin::sendConfirmEmail($confirm, $template); } $confirmUrl = common_local_url('register', array('code' => $confirm->code)); print $confirmUrl."\n"; } catch (Exception $e) { print "ERROR: " . $e->getMessage() . "\n"; }