We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8489
    • 90 Posts
    Eformerz!,

    Is it possible to let eForm act like a WebloginPE register form?

    So that if fields from eForm are filled in, eForm wil send the information to WebLoginPE... so that WebloginPE can create a new user on the fly.

    Thanks,
    Edski
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      VERY good question. eForm does allow for the execution of a Snippet after submission, so I think this must be possible... perhaps you could construct your eForm to mimic those used by WebLoginPE then pass along a couple of the extra fields WebLoginPE expects. I’ve been working on documenting WebLoginPE in the wiki and I’m trying to field these kinds of scenarios. See the WebLoginPE Wiki

      If you work on this, please let us know!
        • 8489
        • 90 Posts
        Hi Everett,

        Thanks for your reply!

        Do you know any other online information similar to what I’am trying to do?

        I also found this topic perhaps this is also a way to do the same?
        http://modxcms.com/forums/index.php/topic,15350.0.html

        I’am struggling what the best way is en how to code this... any help very appreciated!

        PS When I got it to work I sure will place it in the Wiki, I let you people know!

        Thanks,
        Edski

          • 18367
          • 834 Posts
          Everett,

          re
          I’ve been working on documenting WebLoginPE in the wiki and I’m trying to field these kinds of scenarios. See the WebLoginPE Wiki

          Props to you man for doing this.

          It’s something that’s long overdue. (Well at least for some of us.)

          WLPE is like voodoo to some of us non techies. We can get it to work, but we’re never quite sure how we did it, so we make sacrifices at the temple of MODx every night just to appease the beast.

          Well done, keep up the good work.
            Content Creator and Copywriter
            • 29774
            • 386 Posts
            @Edski

            The answer is yes, if you’re handy with PHP you can write your own snippet to handle user registration with data processed through eform, and simply borrow (or extend) from the webloginpe class as necessary.

            But if that sounds daunting then you might be better off taking the reverse approach - make webloginpe behave like eform, see:
            http://modxcms.com/forums/index.php/topic,34924.msg212486.html#msg212486
              Snippets: GoogleMap | FileDetails | Related Plugin: SSL
              • 8489
              • 90 Posts
              Quote from: therebechips at May 06, 2009, 05:25 AM

              @Edski

              The answer is yes, if you’re handy with PHP you can write your own snippet to handle user registration with data processed through eform, and simply borrow (or extend) from the webloginpe class as necessary.

              But if that sounds daunting then you might be better off taking the reverse approach - make webloginpe behave like eform, see:
              http://modxcms.com/forums/index.php/topic,34924.msg212486.html#msg212486

              I think the fist approach is better for me because I need the function from eForm to send a photo as an attachment by mail and I don’t know if that is possible with the topic you pointed me to?

              I think I like the first approachment the most but yeah it sounds a bit daunting... do you know any online examples to get me started.

              Thanks! 
                • 8489
                • 90 Posts
                Could eForm’s &runSnippet make WebLoginPE register new users on the fly?
                And are there any online examples of the eForm’s &runSnippet I checked the docs with eForm package but didn’t find any code examples.

                Thanks!

                Edski
                  • 30223
                  • 1,010 Posts
                  Bridging eForm and WebLoginPE just so yu can send an email sounds a bit convoluted in my opinion and it’s certainly more work than adding a mailer to WebLoginPE. The mailer class is already there and if you look through the eForm.inc.php source there’s plenty of code you can copy.

                  You could write a plugin that’s triggered by WebLoginPE which captures your form data and sends the email. I don;t know WLPE vey well so you’ll have to figure out how it works with plugins (or perhaps someone else can help you with that).

                  As for working with phpMailer... here some sample code to get your started.

                  <?php
                  
                  include_once "manager/includes/controls/class.phpmailer.php";
                  
                  $mail_body = "Make your own message here. For instance use WLPE posted data....";
                  $mail_subject = "Someone registered on your site!";
                  
                  
                  $mail = new PHPMailer();
                  $mail->IsMail();
                  $mail->CharSet = $modx->config['modx_charset'];
                  $mail->IsHTML(1);
                  $mail->From = '[email protected]';
                  $mail->FromName = 'Your Name';
                  $mail->Subject = $mail_subject;
                  $mail->Body = $mail_body;//build this from your form data...
                  $mail->AddAddress('[email protected]');
                  //add attachment...
                  $attachment = $_FILES['replace_with_upload_form_field_name']['tmp_name'];
                  $contentType = $_FILES['replace_with_upload_form_field_name']['type'];
                  if (is_uploaded_file($attachment)){
                     $mail->AddAttachment($attachment,$FileName,"base64",$contentType);
                  }
                  
                  $mail->send(); //ignoring any mailing errors
                  
                  ?>
                  


                    • 8489
                    • 90 Posts
                    Hi TobyL,

                    Thanks for your reply and code, I think it really could help me out!

                    Are there some online docs about "&runSnippet"

                    Thanks,
                    Edski
                      • 9207 ☆ A M B ☆
                      • 2,475 Posts
                      Yeah, it would be nice to do this with a single Snippet... but there’s that nagging thing... WebLoginPE seems to have been nearly abandoned by its author (Scotty? Are you there?), and the documentation had some holes in it that left many of us (myself included) in the dark as to how to actually use it, thus my work on the
                      WebLoginPE Wiki pages.

                      I felt that eForm had better documentation, and one huge advantage that it had was the built in support for regular expressions.

                      The legendary city of gold for many frameworks is the kind of auto-generated form that integrates with a database and auto-updates its elements and their values... WebLoginPE is closer to that, but eForm still has some notable advantages (one of which being that its documentation is more thorough in my opinion).

                      I’m going to do a tutorial video on the web user process, most likely featuring WebLoginPE, and I’ll add it to my collection on my site http://www.tipsfor.us/, but that’s probably a ways off... maybe a month.

                      I’d also like to download the SVN repo and make some of the changes that I’ve been wanting... but as any developer knows, it takes a long time to get under the hood and understand what’s going on, much less fix it. The bugs listed on the Google tracking are fairly minor for the most part, so hopefully if I get the chance to work on the code, I could knock a few of them out.... but the biggest frustration in my opinion is the lack of documentation for certain usage scenarios.

                      Please, if anyone has suggestions or bugs, PLEASE add them to the project list... that’s how these open source things work. Eventually some anonymous person checks out the code and fixes it, and if nobody bothered to file a bug report or feature request, then nothing ever gets fixed, so this is an open invitation to everyone to be involved.

                      To be continued...