We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Instead of simply setting the variable to true, set it to a timestamp, using time() or something similar.

    For the second snippet, compare the variable and if it’s the same, you can set the $vMsg[count($vMsg)]=$_lang[’ef_thankyou_message’]; and return false instead of true. You’ll need to pass the &$vMsg along with the &$fields in the function arguments, or else declare it global in the function body.

    Actually, seems to me that this would be something that could be added to the eForm code itself to prevent resubmissions of the same form.

      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
      • 30223
      • 1,010 Posts
      Quote from: sottwell at Nov 17, 2006, 11:49 PM

      Instead of simply setting the variable to true, set it to a timestamp, using time() or something similar.
      Yes, timestamp is a much better suggestion.

      For the second snippet, compare the variable and if it’s the same, you can set the $vMsg[count($vMsg)]=$_lang[’ef_thankyou_message’]; and return false instead of true. You’ll need to pass the &$vMsg along with the &$fields in the function arguments, or else declare it global in the function body.

      That wouldn’t work for the eformOnBeforeFormParse event . The $vMsg array is not yet initialized by then. You can use the eFormOnValidate event instead though.


      Actually, seems to me that this would be something that could be added to the eForm code itself to prevent resubmissions of the same form.

      Yes, I did have the same thought but didn’t want to mention it.. means I’d have to do more work and I’m busy (and or lazy) at the moment grin I’ll see if I can can come up with something for 1.4.2
        • 10828 ☆ A M B ☆
        • 174 Posts
        eForm is a great tool. Thanks a lot Tobyl... I use UTF-8 encoding in my development, and in this context I had to add this line before sending any mail :

        [tt]$mail->CharSet = $modx->config[’modx_charset’];[/tt]
          Ackwa - Web Design & Development agency | Tours - France | Follow me on Twitter...
          • 21136
          • 103 Posts
          Hello smiley

          I need to be able to insert the following into the header of the email that is being sent. I have spent the past day looking as to how to do it with eForm and I am at a dead-end. Can someone please point me in a direction. Give me the steps of how to get it in.

          Content-Type: application/x-gm-impdata\n\n

          Regards,

          Ken Roberts
            • 23491 ☆ A M B ☆
            • 1,056 Posts
            Quote from: nekstrebor at Nov 28, 2006, 02:31 PM

            Hello smiley

            I need to be able to insert the following into the header of the email that is being sent. I have spent the past day looking as to how to do it with eForm and I am at a dead-end. Can someone please point me in a direction. Give me the steps of how to get it in.

            Content-Type: application/x-gm-impdata\n\n

            Regards,

            Ken Roberts

            I believe eForm uses the PHPMailer class...look through the eForm php files and also /manager/includes/controls to reference PHPMailer if you’re unfamiliar with this class...
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
              • 17802
              • 190 Posts
              Quote from: DNA at Nov 17, 2006, 12:58 PM

              I love this eForm smiley
              Only the validation page is missing from the zip file? Cause i dont understand the validation explanation at the bottom of the index page.
              Me too... I’m using eForm but I don’t really understand how to use validation... and this part of the documentation appears to missing in the zip file. Can I view or download it anywhere? Because I don’t want to bore the forum members with my questions grin
                Thanks for MODx - I love it!
                • 14174
                • 4 Posts
                Newbie question:

                For the following environment:
                Modx: 0.9.5 rev 2106 (soft launch)
                PHP: 5.1.6
                OS: Centos
                eForm: 1.4.1

                Been playing with the default installation. I believe the contact us page [Contact Us (6)] has an error - any sends throws an error "could not instantiate mail function"

                Looking at the code on [Contact us (6)]:
                [[ContactForm? &sendTo=`[(emailsender)]`]]
                
                [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(email_sender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`46`  !]
                


                If I change this to
                [[ContactForm? &sendTo=`[(emailsender)]`]]
                
                [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[email protected]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`46`  !]
                


                it works. But - why is there a email_sender param? Shouldn’t the "&to" parameter be `[(emailsender)]` ?


                  • 29707
                  • 5 Posts
                  "could not instantiate mail function"

                  I’m receiving the same error (using ver. 0.9.5) . in ver. 0.9.2 i used Contact Form and it workd fine.
                    • 33337
                    • 3,975 Posts
                    Quote from: jimg at Dec 07, 2006, 10:06 AM

                    Newbie question:

                    For the following environment:
                    Modx: 0.9.5 rev 2106 (soft launch)
                    PHP: 5.1.6
                    OS: Centos
                    eForm: 1.4.1

                    Been playing with the default installation. I believe the contact us page [Contact Us (6)] has an error - any sends throws an error "could not instantiate mail function"

                    Looking at the code on [Contact us (6)]:
                    [[ContactForm? &sendTo=`[(emailsender)]`]]
                    
                    [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(email_sender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`46`  !]
                    


                    If I change this to
                    [[ContactForm? &sendTo=`[(emailsender)]`]]
                    
                    [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[email protected]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`46`  !]
                    


                    it works. But - why is there a email_sender param? Shouldn’t the "&to" parameter be `[(emailsender)]` ?

                    Why are you using 2 form snippets? ... just remove the [[ContactForm? &sendTo=`[(emailsender)]`]] and you are good. [[ContactForm]] and [[eForm]] are different things.
                      Zaigham R - MODX Professional | Skype | Email | Twitter

                      Digging the interwebs for #MODX gems and bringing it to you. modx.link
                      • 33372
                      • 1,611 Posts
                      I wondered that as well... Then I thought, "Well maybe the default content for 0.95 installs both of those on the same page in order to show how they work." Which didn’t make very much sense to me either, but since I haven’t installed 0.95 with the default content, I figured anything was possible.

                      But the point is, if you want a contact form that works, just use eForm. It’s the newer of the two snippets, and the one that I would recommend. ContactForm is fine if you prefer it, but you certainly don’t need both of them.

                      Or is there something that I’m missing here?
                        "Things are not what they appear to be; nor are they otherwise." - Buddha

                        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options

                      This discussion is closed to further replies. Keep calm and carry on.