We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23571
    • 223 Posts
    I have set up a preHooks snippet (&preHooks=`ActivationEmailTpl) in my [[!Register?]] call to send an email to my site administrator. I would like for the administrator to receive the confirmation URL (a href="[[+confirmUrl]]">[[+confirmUrl]]</a>), rather than the user. I have everything working just fine except I am not successfully calling in the [[+confirmUrl]] into the email that is being generated on registration. I am using the code below in my snippet:
    $message = '<p>You,</p>'.$hook->getValue('fullname').' has registered for. To activate the account, please click on the following link: <a href='.$hook->getValue('confirmUrl').'>'.$hook->getValue('confirmUrl').'</a></p><p>You may want to archive the following information for your records:</p><p>Name: <strong>'.$hook->getValue('fullname').'</strong><br />Email: <strong>'.$hook->getValue('email').'</strong><br />Password: <strong>'.$hook->getValue('password').'</strong></p>.';

      • 28215
      • 4,149 Posts
      1. Why are you sending an email on the "preHook"? preHooks run *before* a form is processed. Wouldn’t you want this in a postHook?

      2. The activation URL is not sent in the postHook parameters, since it’s only generated if &activation=`1`. I’m guessing you have that off. You can file a Feature Request and I can look into getting that moved outside of that so that a postHook could have it.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 23571
        • 223 Posts
        Okay, so my approach is secondary to the fact that I am learning the Login package. My customer would like to receive an email (with an activation link) when an end user registers and then based on the user info easily approve (or not), that user, without having to go to the site and login.

        So, following the registration process am I able to send an email with an activation link to a designated email address, not the email field in the form?
          • 28215
          • 4,149 Posts
          Currently activation only sends an email to the party that registered.

          To send it to a middle man, instead, would require modification to the way Register works. You can always request that as a Feature: http://github.com/splittingred/Login/issues
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 28215
            • 4,149 Posts
            P.S. I’ve released Login 1.4.0-rc1 that allows you to set an &activationEmail property to Register that will send activation emails there instead of to the newly registered user’s email.
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 20413
              • 2,877 Posts
              You rock Shaun!! cool
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                • 23571
                • 223 Posts
                No doubt.