We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3109 ☆ A M B ☆
    • 894 Posts
    Guys, I have a client that wants users to fill out a form which is submitted via email and then it auto posts to a section of the website.

    Can this be done? Is there any plugin like SPForm or FormIt that can do this? If there are any tuts about it I would like to know as well.

    Thanks.
      Benjamin Marte
      Interactive Media Developer
      Follow Me on Twitter | Visit my site | Learn MODX
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      What do you mean "submitted via email"?

      You can send an HTML email that contains a form with an action attribute that will post the form to your site, e.g.

      <form action="http://mysite.com/some/handler" method="post">
      <!-- bla bla -->
      <input type="submit" value="Submit" />
      </form>
      


      OR, you can have them reply to the email, and then use a script to check the email account (e.g. via POP). The first option is much easier, but not everyone is going to have HTML emails enabled... getting emails into inboxes is a tricky business. You could send text emails with a link to where users could fill out the form.

      But auto-posting is notoriously dangerous. Put another way: "Hey, I want Joe Rando to be able to post whatever malicious, dirty, random crap to my site via this automated form that I built with no checks or authorizations whatsoever!" That’s more or less what an auto-post form says to me... and it’s what lots of clients *think* they want, but it’s an attack vector for all kinds of hacks, so you have to filter your submitted data very very carefully.
        • 3109 ☆ A M B ☆
        • 894 Posts
        Everett thanks, thats exactly what I told him.

        He wants the person to fill out the form, the form will be submitted via email and then posted to the site kind of like a blog entry.

        My question now is there some way to have that message instead enter an approval process instead of auto posting? So the admin will have to approve the comment in order for it to display on the site?

        Again, thanks for your help.
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Just set "published" to 0 when the database insert is made.
            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
            • 3109 ☆ A M B ☆
            • 894 Posts
            Quote from: sottwell at Apr 27, 2011, 06:49 AM

            Just set "published" to 0 when the database insert is made.

            Susan, I am using formIt to submit the form via email is it possible to have formIt also post it like a new blog entry unpublished? That way the editor has control if it displays on the site or not sort of like an approval process.

            Any tips or pointers on how to accomplish this would be greatly appreciated Thanks.
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 8609
              • 607 Posts
              Perharps formit2db snippet would come in handy here? I’ve never done it before but I imagine it’s doable.
                • 3749
                • 24,544 Posts
                You can write a postHook snippet for FormIt that will do whatever you want with the submitted data.
                  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