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

    I’ve been working on my first website using Modx and so far I love it,

    However I’ve been trying to get eForm to work on a bookmark tab, you click to bookmark information and it paginates in a drop down div using ditto. The user then has the option to type in a email address and have the bookmarked information sent to their own email address.

    Can anyone point me in the right direction please?

    Thanks in advanced

    Pete.
      • 23081
      • 10 Posts
      [!eForm? &tpl=`bookmarkForm` &sendirect=`1` &formid=`email`!]

      This is what I’ve got so far, so &sendirect=`1` will send the email to the email address thats been typed into form id="email".

      How do I get it to send the information from [!bookmarkedItems!]

      Thanks,
      Pete.
        • 23081
        • 10 Posts
        would i use &report=`[!bookmarkedItems!]` ?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You would need to use a custom snippet/function to work with eForm’s eFormOnBeforeMailSent event, and the function would call
          $fields['bookmarks'] = $modx->runSnippet('bookmarkedItems');

          then you can use [+bookmarks+] in your eform report tpl.

          At least that’s the general idea; you may have to fiddle with your snippet to get the output just the way you want.
            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
            • 23081
            • 10 Posts
            Thanks sottwell, I’ll give that ago. Is the [!eform? &sendirect=`1` part correct?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              If it works, it’s correct.
                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
                • 23081
                • 10 Posts
                nope it isn’t working =[

                Wouldn’t the bookedmarkedItems snippet need to be in the form for the form to process it?
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  No. If it’s working correctly in the function, its return value will be inserted into the $fields array to be used by eForm in generating the report. Try having the snippet return something obvious, like
                  return "Hello, world";

                  and see if that doesn’t get inserted into the report. Then work on getting it to return what you want.
                    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
                    • 23081
                    • 10 Posts
                    thanks i’ll give that a wiz
                      • 23081
                      • 10 Posts
                      I’ve got it to work, I’ve got &report=`SNIPPET NAME` and it seems to email it fine, the only problem I’m having is that I can’t style the snippet using a chunk.

                      I want to be able to &report=`CHUNK NAME` and then print the snippet in the chunk, for example:

                      Your Bookmarks:
                      
                      [[SNIPPET NAME]]
                      
                      Thank you
                      


                      The other problem I’m having, in the template doc for the snippet it allows the page title to be clicked on <a href="[~[+id+]~]">[+title+]</a> but in the email it won’t show it as a hyperlink.

                      Thanks in advanced.

                      Pete.