We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48586
    • 78 Posts
    Hello MODX community, I am using FormIT to post form data to an external DB, which is working great. We just recently got a new CRM to manage leads/forms/etc. I am trying to post the form data to both our DB and the new CRM, but not having much luck. The only suggestion I was able to find on another forum was to use cURL, which unfortunately is not enabled on our server, and after many conversations with my IT team they will not be enabling it any time soon. Is there a way to write a hook so that after adding data to my DB and going to redirect page that the data can be sent to the CRM? Thank you very much

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

    • discuss.answer
      • 3749
      • 24,544 Posts
      If you can get access to it, you could write directly to the CRM's database in a FormIt postHook.

      It's also possible that the CRM has an API that you could communicate with.

      Another option might be to use a JavaScript Ajax call to post to the CRM.
        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
        • 48586
        • 78 Posts
        Thank you, this set me in the right direction for posting to our database and the CRM
          • 3749
          • 24,544 Posts
          I'm glad I could help. smiley

          For others in the same situation, what did you end up doing?
            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
            • 48586
            • 78 Posts
            The CRM we are using is Eloqua, which has 3 basic options on posting form data:


            1. Use the Eloqua landing page to post to the CRM directly
            2. Create the form on your site, but set the form action as the Eloqua URL
            3. Reposting

              • Post to your DB first, the code a repost to the Eloqua CRM
              • Post to Eloqua CRM first, then repost to your DB

            After looking more into the options of the CRM, there is an option that after posting to Eloqua, it will repost the data to your site landing page (I just didn't see that option when first creating the form)

            So, on my site, I created the form with all styling and used the action of the CRM, then I set a repost action to a non-indexed page with a duplicate of the form using FormIT and a custom created snippet as the first action that posted my data to my external DB, and a hook for a redirect to a thank you page.
              • 3749
              • 24,544 Posts
              Thanks. wink I'm sure others will find that helpful.
                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