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

    I need to access a variable (the email address) in the successMessage. I'm setting the variable in the forgotPasswordHook, and it's accessible in the +emailTo and in the emailTpl, but not in the successMessage. How can I get this variable from the hook to the successMessage?

    [[!FormIt?
       &hooks=`spam,forgotPasswordHook,email`
       &emailTpl=`forgotPasswordEmailTpl`
       &emailTo=`[[+email]]`
       &successMessage=`[[$forgotPasswordSuccessMsg]]`
       &validate=`username:required,
                  server:required`
    ]]


    $forgotPasswordSuccessMsg:
    <p><img src="assets/images/mail_sent_ok.png" alt="" width="32" height="32" /> An email with your new password is sent to <a href="mailto:[[+email]]">[[+email]]</a></p>


    Grateful for help.
    Thanks smiley

    This question has been answered by BobRay. See the first response.

      • 8830
      • 98 Posts
      A little bump smiley

      This has to be possible to achieve somehow. No clues MODX experts ?!
      • discuss.answer
        • 3749
        • 24,544 Posts
        Assuming that you're setting the placeholder in one of the hooks, try this:

        &successMessage=`[[!+placeholdername]]`


        I'm not sure it will work, but it's worth a try.

        You could also try putting the placeholder on the page outside of the FormIt tag and use setPlaceholder() in a hook.
          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
          • 8830
          • 98 Posts
          Uncached trick didn't work. But setPlaceholder did smiley
          Thank you.