We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47633
    • 11 Posts
    Good afternoon, I'm having issue getting Login to send an activation email when a user signs up.
    After signing up a test user, using the registration form, the user is created (but deactivated) as would be expected. But no email is sent.

    I am able to send email from MODx through other means, e.g. this snippet works:

    $to = "<emailaddr>";
     $subject = "Hi!";
     $body = "Hi,\n\nHow are you?";
     if (mail($to, $subject, $body)) {
       echo("<p>Message successfully sent!</p>");
      } else {
       echo("<p>Message delivery failed...</p>");
      }


    The QuickEmail plugin by bobray also works and sends email that I can receive. I am perplexed. Does the Login plugin use a different method to the rest of MODx?

    Any ideas would be appreciated. Thanks a lot.
      • 3749
      • 24,544 Posts
      My guess would be that something is wrong with one or more of the properties in the Register snippet tag.
        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
        • 47633
        • 11 Posts
        Thanks for the fast reply BobRay,

        The snippet on the registration page is:

        [[!Register? &submitVar=`registerbtn` &activationResourceId=`40` &activationEmailTpl=`ActivationEmailTpl` &activationEmailSubject=`Thanks for Registering!` &submittedResourceId=`39` &usergroups=`Members` ]]


        As I mentioned, it does create the users account - So I assumed that meant I set it up correctly. Anyway:


        • activationResourceId is the Registration Confirmation Handler, containing [[ConfirmRegister? &redirectTo=`1`]]
        • submittedResourceId goes to a Request Pending page.

        I believe this is how it is supposed to be configured, I followed:
        http://rtfm.modx.com/extras/revo/login/login.tutorials/login.request-membership

        Thanks,
        - Chris
          • 3749
          • 24,544 Posts
          Make sure you have a chunk called ActivationEmailTpl (not ActivateEmailTpl) with that exact spelling (case-sensitive).
            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
            • 47633
            • 11 Posts
            Thank you so much. This was the issue.

            For some reason, all Login templates are prepended with 'lgn' e.g. 'lgnActivateEmailTpl'.
            I installed Login via the package manager, I didn't make any of the chunks myself. I guess there must be a difference between the Login install nomenclature and the tutorial. In addition, the template I had was actually called 'lgnActivationEmailTpl' - you were right on that too.

            - Chris
              • 3749
              • 24,544 Posts
              Glad I could help. smiley
                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