-
☆ A M B ☆
- 476 Posts
So I’m using the WebSignup snippet but not finding the documentation I need for it. Basically I’ve set up the WebSignup snippet on my site so people can get a membership, but once they signup, I have the snippet put their account on hold until I first approve them...I have them assigned a to a membership level that basically does nothing. Problem is, how will I know if someone has signed up and waiting on my approval? I know with Jot, it’s got a functionality for this to control the comments and hold for Manager approval. Does WebSignup have this or anyone know documentation where this can be found?
Thanks!
Precision Web Development ... SmashStack.com
A plugin would work, create a new plugin with the following code, making sure to check the OnWebSaveUser event.
Modify to fit your application.
<?php // only here for highlighting
/* EmailAdmin_plugin
// check the OnWebSaveUser event
These are the available Webuser variables you can use/send in the email
$mode ="new";
$userid
$username
$userpassword
$useremail
$userfullname
*/
// MODIFIABLE SETTINGS
// set up a comma delimited list of the address(s) which will receive the notifications
$recipient_email_array = array("[email protected]","[email protected]");
// set up the content of the message
$email_content_string =$userfullname." has created a new account.\n Please login to the manager and verify the account.";
// Handle event
$e = &$modx->Event;
switch ($e->name) {
case "OnWebSaveUser":
if($mode =="new"){
if(isset($recipient_email_array)){
$countarray = count($recipient_email_array);
if($countarray > 0 ){
foreach ($recipient_email_array as $rea){
// send html email receipt to admin(s)
mail($rea, 'New Webuser Account',
$email_content_string,
"From: Admin Name <[email protected]>\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");
}
}
}
}
break;
default: "";
return;
}
-
☆ A M B ☆
- 476 Posts
Thanks to both of you for your advice. I had looked at WebLoginPE, but I was hoping to stay with just the standard WebSignup snippet and just slightly modify it. I’ll give this plugin a spin right now and see how it goes...thnx again!
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 476 Posts
This is what we ended up using that worked great:
<?php
/* We are not in the frontend. An admin has created this user. So dont send this email. */
if( ! $modx->isFrontend() )
{
return;
}
$userfullname = (isset($fullname)) ? $fullname : ''; /* If userfullname is not set, make it empty so php doesnt throw errors. */
/*Available user variables
* $mode (default is new)
* $userid (required)
* $username (required)
* $userpassword (required)
* $useremail (required)
* $userfullname (optional)
*/
$email_to = array('[email protected]', '[email protected]');
$email_from = '[email protected]';
$email_subject = 'New Webuser Account on Website';
$email_message = $username." has created a new account.\n Please login to the manager and verify the account.";
// Handle event
$e = &$modx->Event;
switch ($e->name) {
case "OnWebSaveUser":
if($mode =="new"){
if(isset($email_to)){
$countarray = count($email_to);
if($countarray > 0 ){
foreach ($email_to as $rea){
// send html email receipt to admin(s)
mail($rea, $email_subject,
$email_message,
"From: Admin Name ".$email_from.">\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");
}
}
}
}
break;
default: "";
return;
}
Precision Web Development ... SmashStack.com