We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53460
    • 69 Posts
    I can't figure out what I'm doing wrong. I have the sample form from the Docs on my page with this code. I'm also using a template variable that is defined on my contact page of [[*contactEmail]] and my success page is resource #14 which is what I'm trying to redirect to. But not only will it not redirect, but I never get the email either.
    							[[!FormIt?
                                    &hooks=`email,redirect`
                                    &emailTpl=`MyEmailChunk`
                                    &emailTo=`[[*contactEmail]]`
                                    &redirectTo=`14`
                                    [[-&validate=`
                                        nospam:blank,
                                        name:required,
                                        email:email:required,
                                        subject:required,
                                        text:required:stripTags,
                                        numbers:required,
                                        colors:required`]]
                                ]]
    


                                [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]
                                 
                                <form action="[[~[[*id]]]]" method="post" class="form">
                                    <input type="hidden" name="nospam" value="" />
                                 
                                    <label for="name">
                                        Name:
                                        <span class="error">[[!+fi.error.name]]</span>
                                    </label>
                                    <input type="text" name="name" id="name" value="[[!+fi.name]]" />
                                 
                                    <label for="email">
                                        Email:
                                        <span class="error">[[!+fi.error.email]]</span>
                                    </label>
                                    <input type="text" name="email" id="email" value="[[!+fi.email]]" />
                                 
                                    <label for="subject">
                                        Subject:
                                        <span class="error">[[!+fi.error.subject]]</span>
                                    </label>
                                    <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" />
                                 
                                    <label for="text">
                                        Message:
                                        <span class="error">[[!+fi.error.text]]</span>
                                    </label>
                                    <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
                                 
                                    <br class="clear" />
                                    [[!+formit.recaptcha_html]]
                                    [[!+fi.error.recaptcha]]
                                 
                                    <br class="clear" />
                                 
                                    <div class="form-buttons">
                                        <input type="submit" value="Send Contact Inquiry" />
                                    </div>
                                </form>
    


    Thanks
      • 17301
      • 932 Posts
      Looks like you have some extra '[[ ]]' in your formit call.

      Try

      [[!FormIt?
          &hooks=`email,redirect`
          &emailTpl=`MyEmailChunk`
          &emailTo=`[[*contactEmail]]`
          &redirectTo=`14`
          &validate=`nospam:blank,
              name:required,
              email:email:required,
              subject:required,
              text:required:stripTags,
              numbers:required,
              colors:required`
      ]]
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 3749
        • 24,544 Posts
        It may also confuse FormIt to have a comment tag in the properties list. The tag may or may not be removed before FormIt gets the properties list.
          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
          • 53460
          • 69 Posts
          Quote from: BobRay at Apr 23, 2018, 10:03 PM
          It may also confuse FormIt to have a comment tag in the properties list. The tag may or may not be removed before FormIt gets the properties list.

          Thanks Bob, when I removed the comment section it redirected properly. Unfortunately, I never received the email though.
            • 3749
            • 24,544 Posts
            Does QuickEmail work to send email?

            In my experience, the most common problem with FormIt email is a sender (the "from" address) who doesn't have an email account with the host.
              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
              • 17301
              • 932 Posts
              ^ As above. Lack of a subject can also be flagged and blocked as spam by some clients. Make sure you also have authority to send from the domain (DKIM)
                ■ email: [email protected] | ■ website: https://alienbuild.uk

                The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                • 53460
                • 69 Posts
                Quote from: lkfranklin at Apr 26, 2018, 08:40 AM
                ^ As above. Lack of a subject can also be flagged and blocked as spam by some clients. Make sure you also have authority to send from the domain (DKIM)

                Currently it is running off of my localhost machine.
                  • 17301
                  • 932 Posts
                  And you've setup sendmail correctly ?
                    ■ email: [email protected] | ■ website: https://alienbuild.uk

                    The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • 3749
                    • 24,544 Posts
                    Try the QuickEmail extra. If it doesn't work, it's not a problem with FormIt.

                    It's tricky sending from localhost. Try sending through SMTP via another email account like Gmail (be sure to set the SMTP system settings). Using localhost as the sender's domain has never worked for me.
                      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