We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4384
    • 5 Posts
    Hello!

    I’ve gotten FormIt to work with a rather simple form and the recaptcha,email,spam, and redirect hooks implemented.

    However, I can only get it to send via SMTP if I declare smtp settings in the [[!FormIt?...]] snippet.

    Setting the SMTP properties for the FormIt snippet doesn’t seem to accomplish anything, and neither does setting the SMTP properties under the System Settings ->Mail properties.

    Also, when it DOES send via SMTP, the e-mail is blank; I am using the MyEmailChunk example to test with until I get things configured correctly.

    So basically TL;DR - I can only send via SMTP when passing properties like the Gmail SMTP example. The received e-mail is blank.

    Thanks for the help and a great piece of code!

    Cheers,
    Ian
      • 3749
      • 24,544 Posts
      I’ve used the SMTP System Settings to get FormIt to send email with no trouble. If you’re setting them in both Formit and the System Settings, that might confuse things. Be sure to clear the cache after making changes. I would use the system settings alone. Check the spelling and capitalization of your MyEmailChunk name against the snippet parameter.

      Try this as your FormIt emailTpl chunk:

      <p>This is the Formit Email Chunk.</p?
      
      <br />[[+name]] ([[+email]]) Wrote: <br />
      
      [[+text]] 
        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
        • 4384
        • 5 Posts
        Thanks Bob, I will give this a whirl and let you know what the outcome is.

        Sorry it took my so long to get back, I spent a week fighting a barn full of old Porsches...

        Cheers,
        Ian
          • 4384
          • 5 Posts
          Ok, setting SMTP via the System Settings menu, and setting the FormIt settings back to default, aside from SMTP enabled to yes, does not yield results.

          I am still only able to trigger functioning of FormIt hooks by passing them explicitly in the snippet call.

          FormIt does not seem to be receiving the parameters passed via the Property Sets so, I will remove FormIt and re-install, in case I’ve just borked it.

          Cheers,

          Ian
            • 3749
            • 24,544 Posts
            Quote from: BWAutosport at Aug 06, 2010, 04:43 PM

            Ok, setting SMTP via the System Settings menu, and setting the FormIt settings back to default, aside from SMTP enabled to yes, does not yield results.

            I am still only able to trigger functioning of FormIt hooks by passing them explicitly in the snippet call.

            FormIt does not seem to be receiving the parameters passed via the Property Sets so, I will remove FormIt and re-install, in case I’ve just borked it.

            Cheers,

            Ian

            Ian, it definitely worked for me, although with an earlier version of FormIt.

            FormIt doesn’t need to know anything about it. It just hands the message to MODx and says "send this." Then the MODx mailer send the message using SMTP (assuming that all the SMTP system settings are correct).
              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
              • 4384
              • 5 Posts
              Well it seems Formit is getting the parameters passed to it. This worked after realizing I needed to pass [[!Formit@FormitLocal]] where FormitLocal is my copy of the property set modified to my settings. However, it’s not seeing the emailTo parameter, so the form submit fails, and simply says "You must provide an email address to send to."

              So, I need to track this down.

              Recaptcha is working, which is passed as a parameter in my property set, re-direct is not, but this is to be expected since the email hook fails.

              Thoughts on this?

                • 3749
                • 24,544 Posts
                I’m not sure about that problem, but I re-read your message above and I should have mentioned that if the System Settings are set for SMTP, you *shouldn’t* use any SMTP directives at all in the FormIt tag (not even the one that tells it to use SMTP). Otherwise, the empty FormIt SMTP parameters that you don’t set may end up being used and both FormIt and MODx will be trying to use SMTP at the same time with possible confusion.

                FormIt should just think it’s sending the mail the normal way.
                  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
                  • 4384
                  • 5 Posts
                  Ok, got it sending now and receiving.

                  Message is coming through, and passing all fields from my form. It is also appending the recaptcha specifics, which is fine I suppose.

                  When setting the parameters for passing fields into the form, emailFrom, emailFromName, emailSubject, etc...
                  Do I set to true false using 0/1, yes/no, true/false?

                  Documentation does not mention passing parameters this way. I’ve attempted to set to true using 1 but I get an error message bounced back...but I’m getting there!

                  Thank you for your patience and helping me to stumble along! Won’t forget after this... rolleyes
                    • 3749
                    • 24,544 Posts
                    Glad you got it working. smiley

                    All parameters in MODx are put in backticks and all the boolean parameters I know of take `1` or `0` although it’s up to the snippet author so a few snippets will also accept `true` and `false.` I’ve never seen one that wouldn’t take `1` and `0` so that’s the safest.
                      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