We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ 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
      • 6038
      • 228 Posts
      I know that you can do this if you use WebLoginPE snippet, using the ’notify’ parameter
      Maybe check it out - it’s a great snippet!
      eg:
      [!WebLoginPE? &type=`register` &regType=`verify` &notify=`[email protected]` &notifyTpl=`registrationNotification` 
      &regRequired=`fullname,email,company,address1,suburb,phone,fax,formcode,tos` &groups=`Pending Users`  
      &messageTpl=`wlpe_message` &registerTpl=`wlpe_registerFormVerify` !] 
        • 4041
        • 788 Posts
        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;
        }
          xforum
          http://frsbuilders.net (under construction) forum for evolution
          • 33982 ☆ 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
            • 5340
            • 1,624 Posts
            Not sure it will work but you might try to modify this to work with OnWebSaveUser event.
              • 33982 ☆ 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