We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42364
    • 8 Posts
    System: MODX Revolution 2.3.1-pl (traditional)
    Plugin: FormIt

    Hello all,

    hope somebody could help me out:
    My hairs are getting grey over FormIt.
    I have a small contact form. See code below.
    And it is taking approx. 10-15 seconds to send via SMTP .
    When adding recaptcha, the form does not validate and error-returns that captcha is incorrect.

    Any ideas?
    Help is highly appreciated.

    [[!FormIt?
    &hooks=`email,redirect,FormItAutoResponder`
    &emailTpl=`sentEmailTpl`
    &emailSubject=`Message from ….`
    &emailTo=`(mail)`
    &emailFrom=`(mail)`
    &validate=`contact_name:required:minLength=^2^,
          contact_email:email:required,
          contact_message:required`
    &redirectTo=`29`
    &fiarTpl=`autoResponseTpl`
    &fiarSubject=`Thank You for Contacting Us`
    &fiarToField=`contact_email`
    &fiarFromName=`NAME`
    ]]
    <form id="contactForm" class="cmxform" method="post" action="[[~[[*id]]]]">
    <strong>Please use the form below to send us an email:</strong>
    <div>
    <label for="contact_name">Name </label><em>(required, at least 2 characters)</em><br />
    <input id="contact_name" name="contact_name" size="30" class="required" minlength="2" value="[[!+fi.contact_name]]" />[[!+fi.error.contact_name]]
    </div>
    <div>
    <label for="contact_email">E-Mail </label><em>(required)</em><br />
    <input id="contact_email" name="contact_email" size="30"  class="required email" value="[[!+fi.contact_email]]" />[[!+fi.error.contact_email]]
    </div>
    <div>
    <label for="contact_message">Your comment </label><em>(required)</em><br />
    <textarea id="contact_message" name="contact_message" cols="70" rows="7" class="required">[[!+fi.contact_message]]</textarea>[[!+fi.error.contact_message]]
    </div>
    <div>
    <input name="submit" class="submit" type="submit" value="Submit"/>
    </div>
    </form>
    




      • 19872
      • 1,078 Posts
      &emailTo=`(mail)`
      &emailFrom=`(mail)`

      Did you put (mail) in your formit call for the purposes of your question?
      Please forgive me if you already know, but if using a placeholder, it must be inserted as [+placeHolderName]
      Or it must have a complete email address.

      Same with the subject line. &emailSubject=`Message from ….` should be &emailSubject=`Message from [+contact_name]`

      Regarding &emailFrom=`(mail)`, some servers require that a valid email address be used. In some instances, you can use an arbitrary email user with the domain, but in others, there must actually be a valid email address set up. I don't fully understand the reasoning other that some servers are setup to be more secure and if require the ability for the hosting company to be able to shut down the outgoing mail for the account in the event of spam. Not a bad idea actually, in case your form gets hijacked.

      Regarding reCaptcha, I was able to finally get it set up and working on one of my forms, only to realize that the images were simply to blurry to read and made for a very non-user friendly form. So, I removed it. Using a hidden field, that if populated, prevents the sending of the form and has proven successful for me against computer bots, but not humans.
      http://rtfm.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.using-a-blank-nospam-field

      Same placeholder point here:
      &fiarToField=`contact_email`

      Should be:
      &fiarToField=`[+contact_email]`

      The following will put the word "NAME" in front of the email address you have set in the system setting.
      &fiarFromName=`NAME`

      Since you omitted &fiarFrom, the system defaults to the email address in your system setting. Have you inserted your preferred email address in the system settings?

      Regarding the length of time to send, this could have something to do with your formit setup, whether the placeholders are properly setup. One has to ask. Is the length of time related to MODx trying to process the formit call, or the actually mail server sending out the email? I have noticed lately with many of my IMAP email accounts, that mail is taking a considerable time to send compared to send times in the past, and to date, I have not determined the source of the issue. Some days are faster than others. Could be that mail servers are simply overwhelmed by the volume of today's email traffic?
        • 48806
        • 8 Posts
        A really strange situation but it now works - I don't know what I did ( I didn't do much ) all I did was retype some stuff to neaten it up (bit OCD) I din't why I tried it again but it now works ( I do get the occasional delay )

        I'm going to go through the what I did and if I understand why I'll post

        Thanks for all the suggestions


        Paul