We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8939
    • 6 Posts
    I’m a new MODx user and although I really like the CMS, I still have some things to learn.
    My website has two forms and I don’t know how to process them using the eForm snippet.
    The first form is a normal contact form, while the second form has more fields. Nothing really complicated though.
    I would love to send the form submissions to my email address, and then send a confirmation email to the user that the form submission has been received (Just like an autoresponder).
    Can anyone please tell me how to do this? I would really appreciate your input.
    Thanks a lot.
    • Hello,

      It’s a matter of putting together a very long string of &parameters that refer to chunks you’ll have to build. For example, you could do something like this:

      [!eForm?&formid=`visit`&to=`[email protected]`&cc=`[email protected]`&from=`[email protected]`&tpl=`visitform`&report=`visitemail`&automessage=`visitmessage`&requiredClass=`invalid`&gotoid=`12`&protectSubmit=`0`&subject=`Visit Us`!]

      &tpl refers to the form (in a chunk) that is filled out.
      &report refers to the email that is sent to you (again, a chunk).
      &automessage is the email chunk that is sent to the person who filled out the form.
      &requiredClass attaches a class name to an invalid form field

      It’s best to consult the documentation that is in the snippet folder (assets/snippets/eform/docs) as well as examine the placeholders and how the sample forms and emails are created.
        • 8939
        • 6 Posts
        HI rx2,
        Thanks a lot for your reply. I think I understand it better now. One quick question though, how do I get the &automessage chunk to be emailed to the visitors’ email addresses? Do I have to specify the "email" form field with any particular name? That part really confuses me. Also, I would love to validate some form fields. How do I do that?
          • 7231
          • 4,205 Posts
          eForm does that for you. These are the auto responder parameters:
          # &autosender (Optional)
          email to display as sender of the auto-respond message e.g. [email protected]
          # "autoSenderName (new in 1.4.4) (optional)
          Name to display as sender of the auto-respond message.
          # &automessage (Optional)
          chunk name (non-numeric) or document id (numeric) to use as an auto-responder message Can include [+form fields+]. E.g. [+firstname+] - tags: [form_fields],[postdate] - note: eForm will send the auto-respond message to the email address specified inside the [email] form field.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]