From: Evan Prodromou Date: Wed, 4 May 2011 18:37:32 +0000 (-0700) Subject: Option for custom template for confirmation email X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aef62ccbcc5930692b86c2136fe15df6b9b0cbea;p=quix0rs-gnu-social.git Option for custom template for confirmation email --- diff --git a/plugins/DomainStatusNetwork/scripts/installforemail.php b/plugins/DomainStatusNetwork/scripts/installforemail.php index 037e0cad1f..98ce620c28 100644 --- a/plugins/DomainStatusNetwork/scripts/installforemail.php +++ b/plugins/DomainStatusNetwork/scripts/installforemail.php @@ -22,15 +22,16 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); -$shortoptions = 'w'; -$longoptions = array('welcome'); +$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 +-w --welcome Send a welcome email +-t --template= Use this email template END_OF_INSTALLFOREMAIL_HELP; @@ -62,7 +63,13 @@ StatusNet::switchSite($sn->nickname); $confirm = EmailRegistrationPlugin::registerEmail($email); if (have_option('w', 'welcome')) { - EmailRegistrationPlugin::sendConfirmEmail($confirm); + if (have_option('t', 'template')) { + // use the provided template + EmailRegistrationPlugin::sendConfirmEmail($confirm, get_option_value('t', 'template')); + } else { + // use the default template + EmailRegistrationPlugin::sendConfirmEmail($confirm); + } } $confirmUrl = common_local_url('register', array('code' => $confirm->code)); diff --git a/plugins/EmailRegistration/scripts/registeremailuser.php b/plugins/EmailRegistration/scripts/registeremailuser.php index a9eff9a848..02915240d3 100644 --- a/plugins/EmailRegistration/scripts/registeremailuser.php +++ b/plugins/EmailRegistration/scripts/registeremailuser.php @@ -20,14 +20,15 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); -$shortoptions = 'w'; -$longoptions = array('welcome'); +$shortoptions = 'wt::'; +$longoptions = array('welcome', 'template='); $helptext = << Options: --w --welcome Send a welcome email +-w --welcome Send a welcome email +-t --template= Use this email template register a new user by email address. @@ -44,7 +45,13 @@ $email = $args[0]; $confirm = EmailRegistrationPlugin::registerEmail($email); if (have_option('w', 'welcome')) { - EmailRegistrationPlugin::sendConfirmEmail($confirm); + if (have_option('t', 'template')) { + // use the provided template + EmailRegistrationPlugin::sendConfirmEmail($confirm, get_option_value('t', 'template')); + } else { + // use the default template + EmailRegistrationPlugin::sendConfirmEmail($confirm); + } } $confirmUrl = common_local_url('register', array('code' => $confirm->code));