We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10405
    • 288 Posts
    I'm having issues with a Register snippet on a Revolution 2.3.5 site, which is adding the unconfirmed user accounts onto the system successfully but which is not sending out any confirmation emails (or any others).

    I saw a previous post on this from a long time ago and tried to follow that but most of the settings seem to be different now and I would have thought the bugs reported at that point would be fixed in the latest version anyway (I'm using Login 1.9.1)

    My Register call for the registration form is as follows:

    [[!Register? &submitVar=`registerbtn` &activationResourceId=`346` &activationEmailTpl=`myActivationEmailTpl` &activationEmailSubject=`Thanks for Registering` &submittedResourceId=`344` &usergroups=`SpecNotepadUsers` &validate=`nospam:blank, username:required:minLength=^6^, password:required:minLength=^6^, password_confirm:password_confirm=^password^, fullname:required, email:required:email` &placeholderPrefix=`reg.` ]]
    


    And the form is as follows:

    <div class="register">
    <div class="registerMessage">[[!+reg.error.message]]</div>
    <form class="form" action="[[~[[*id]]]]" method="post"><input type="hidden" name="nospam" value="[[!+reg.nospam]]"> <label for="username">[[%register.username? &namespace=`login` &topic=`register`]] <span class="error">[[!+reg.error.username]]</span> </label> <input id="username" type="text" name="username" value="[[!+reg.username]]"> <label for="password">[[%register.password]] <span class="error">[[!+reg.error.password]]</span> </label> <input id="password" type="password" name="password" value="[[!+reg.password]]"> <label for="password_confirm">[[%register.password_confirm]] <span class="error">[[!+reg.error.password_confirm]]</span> </label> <input id="password_confirm" type="password" name="password_confirm" value="[[!+reg.password_confirm]]"> <label for="fullname">[[%register.fullname]] <span class="error">[[!+reg.error.fullname]]</span> </label> <input id="fullname" type="text" name="fullname" value="[[!+reg.fullname]]"> <label for="email">[[%register.email]] <span class="error">[[!+reg.error.email]]</span> </label> <input id="email" type="text" name="email" value="[[!+reg.email]]"> <br class="clear">
    <div class="form-buttons"><input type="submit" name="registerbtn" value="Register"></div>
    </form></div>
    


    I've made sure SMTP is turned off. The DNS for the domain the site uses is held elsewhere but mail is turned off for this site on the server anyway, plus I set the "From" account (site owner) as a different external email account @ a different domain.

    The same Register code works fine on another site with a different host, but the hosting company (like they all do) insist that it "must be a code issue" so I'm trying to see how that could be. They won't provide any more help and I really don't want to have to migrate away a site as big as this. From what they've told me, it seems that no email is even being generated so it isn't a routing issue.

    Has anyone got any ideas as to how I can this working please?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      First, install BobRay's QuickEmail and make sure that email works at all on the server.

      Are you sure that the chunk for the email is named "myActivationEmailTpl"?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3749
        • 24,544 Posts
        If mail() is turned off, shouldn't you be using SMTP?

        I think some servers will balk at using a 'from' address from a different server when sending mail. That might not be the case with SMTP.

        BTW, the Subscribe extra will wrap the register process for you. It's easier and more secure than Register, and it provides some other nice options.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 10405
          • 288 Posts
          Thanks both. I got the hosts to confirm that mail is working and functional, and also ran my own tests. I'll check the chunk name... if I get no joy I'll have a look at the Subscribe extra- as the registration process will eventually be open to all, anything that improves security is good. smiley
            • 10405
            • 288 Posts
            Ok- this is weird- I got the email working, but now the Activation page comes up completely blank, as if [[!ConfirmRegister]] doesn't fire at all. If I remove the snippet from the page then the page loads fine (albeit useless) so it isn't a problem with the page.

            [[!ConfirmRegister? &authenticate=`1` &redirectTo=`347` &errorPage=`349`]]
            


            Definitely an issue with ConfimRegister as I renamed / archived away all the Register-based pages and installed Subscribe instead. I could fill in the form, got the email and clicked the link... and the activation page is blank. [ed. note: galahad5 last edited this post 10 years, 9 months ago.]
              • 3749
              • 24,544 Posts
              Is there anything in the MODX Error log that might be relevant?
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 10405
                • 288 Posts
                Quote from: BobRay at Dec 16, 2015, 03:13 PM
                Is there anything in the MODX Error log that might be relevant?

                Only thing is this, which looks similar to the Register issue, although from the timestamp it corresponds with the Confirmregister blank page:

                [2015-12-16 16:36:15] (ERROR @ /connectors/index.php) Could not get table class for class: modAccess
                [2015-12-16 16:36:15] (ERROR @ /connectors/index.php) Could not get table name for class: modAccess
                [2015-12-16 16:36:15] (ERROR @ /connectors/index.php) Error 42000 executing statement: 
                Array
                (
                    [0] => 42000
                    [1] => 1064
                    [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 35' at line 1
                )
                
                  • 3749
                  • 24,544 Posts
                  I agree that the problem is most likely in the ConfirmRegister controller, but you'd have to add some debugging statements to it to pinpoint the problem.

                  core\components\login\controllers\web\ConfirmRegister.php
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 10405
                    • 288 Posts
                    Quote from: BobRay at Dec 17, 2015, 01:39 PM
                    I agree that the problem is most likely in the ConfirmRegister controller, but you'd have to add some debugging statements to it to pinpoint the problem.

                    core\components\login\controllers\web\ConfirmRegister.php

                    Ok- no idea how I would do that unfortunately. What would these statements be? Where in the file should they be placed? Thanks.
                      • 3749
                      • 24,544 Posts
                      Sorry, I'm afraid it's not something I could walk you through without spending more time than I have to spare.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting