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

    I'd like to know what placeholders can be used in the emailTpl of ForgotPassword snippet as they are not specified in the documentation.

    Looking at the code in GitHub from here onwards, it seems that the snippet retrieves the user and profile as arrays into the properties array that is ultimately fed to $this->modx->getChunk, so I guess it's all there.

    But what are the placeholders for various data, for example user's full name? Is there any function or something that I could use in the chunk to make it dump all available placeholders?

    Is there any documentation about the available placeholders for the various snippet templates? ..at least for the ones that are developed by the core team? Can't seem to find any...


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 3749
      • 24,544 Posts
        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
        • 7923
        • 4,213 Posts
        Thanks, but for example [[+fullname]] doesn't seem to be available in ResetPassword template. [[+username]] is and perhaps also some other fields, but don't know what.

        Isn't there a way to dump somehow available placeholders from the template with some snippet code? Or are the template placeholders readable by a snippet in the same template?


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 3749
          • 24,544 Posts
          Hmmm . . . I assumed that it used $modx->toArray() and set all the placeholders. I looked at the code, and it looks like it doesn't set anything but the email and username.

          You might try putting this in the email Tpl chunk:

          [[+user.fullname]]


          I'm not sure it would work. If not, you might be able to get the user object yourself and set a placeholder in your own snippet, called at the top of the page. The Profile snippet might also work there.
            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