We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41127
    • 23 Posts
    This is a bit 'complex'. I'm using a plugin OnPageNotFound wich i use to redirect to a specific page after some checks when someone visits a dynamic build page with soap data. Now i have a contact form, for one of the generated items. All the paths that correspond with a custom function which generates a furl are send to one resource id, so

    foo/bar/100/baz

    is a page not found, the plugin kicks in, gets the 100 (item id), makes our soap call, if object exists and the faux path created trough our function is identical to the one being visited, the plugin makes a $modx->sendForward() to one resource used for all soap generated items. The resource has its own template, in this template we only have some basic theming and a snippet. This snippet again takes the item id and generates the page. Now on that page we display a form, which is nicely in a chunk. But where in this whole process do we call FormIt? I tried it in the chunk, no luck. I basically tried it everywhere...
      • 41127
      • 23 Posts
      Basically i was hoping i could use the FormIt snippet in the chunk and drop the action element of the form.
        • 40045
        • 534 Posts
        What do you want to do with that form? To get FormIt processed it needs to be submitted I think...
          • 41127
          • 23 Posts
          It is getting submitted, as a regular form. The form itself does really nothing spectacular just sends a contact email.

          I'm just not sure if formit can get the data because of the redirects and forwards. I tried running it as $modx->runSnippet() but couldn't get the form to grab the data that way either, so i was thinking that maybe a) formit does not work without its form having no action attribute (submitting to it's own page) or b) it can't handle / grab the data because of the redirects.
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            If you use $modx->sendForward() it wont trigger a redirect, so FormIt should be able to just work with that kind of workflow.. you might want to open up firebug/dev tools to make sure there's no htaccess or other unrelated redirect going on... Sure sounds more complex than it needs to be to me tho tongue
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 40045
              • 534 Posts
              What do you pass to FormIt as parameters?

              Maybe you could also try to send that email with modMail http://rtfm.modx.com/display/revolution20/modMail?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                If you need FormIt to process the submitted form, then pass data back to the SOAP source, you should be able to use the "store" property and the FormitRetriever snippet.

                If you need to provide data to the FormIt before the form is displayed, you should be able to use a prehook to get the data, as long as the FormIt snippet is called after the data is available.
                  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
                  • 41127
                  • 23 Posts
                  Thanks for all the input, even tough i like the formit principle and it's hooks etc. I went with modSwiftMailer.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Whatever works wink
                      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