We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47775
    • 16 Posts
    The form and the snippet call still in the same page?? i don't need another thing only that??
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Well, you also need the chunk tpl for the email to be sent, but basically all you need is the FormIt snippet (uncached!) and a form.

      I usually just copy/paste from the tutorial here, then modify it to suit myself.

      Watch out for that &validate property! The whole thing has to be in the backticks, and you can't have the last validation option followed by a comma. So in my case, you saw
      &validate=`name:required,
            email:email:required,
            text:required:stripTags`


      It's recommended to start out without the &validate property, then once your form is working, add the &validate property and its options.
        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
        • 47775
        • 16 Posts
        Nothing is working see what i did

        THIS IS THE SNIPPET CALL

        [[!FormIt?

        &hooks=`email`
        &emailTpl=`messageContentTpl`
        &emailSubject=`Website Contact`
        &emailTo=`[email protected]`
        &emailFrom=`[[++emailsender]]``

        ]]

        AND THIS THE FORM

        <form role="form" method="post" action="/[[~3~]]" >
        <div class="form-group">
        <input type="text" class="form-control" placeholder="Nom">
        <span class="help-block" style="display: none;">Veuillez entrer votre nom.</span>
        </div>
        <div class="form-group">
        <input type="email" name=`email` class="form-control" placeholder="Adresse e-mail">
        <span class="help-block" style="display: none;">Veuillez entrer une adresse e-mail.</span>
        </div>
        <div class="form-group">
        <textarea rows="10" cols="100" class="form-control" id="message" name="message" placeholder="Message"></textarea>
        <span class="help-block" style="display: none;">Entrez votre message.</span>
        </div>
        <!--placer ici le capcha-->

        <div class="form-group" style="margin-top: 10px;">
        <input type="text" class="form-control" name="captcha_code" placeholder="Pour des raisons de sécurité rentrer le code affiché sur l'image." />
        <span class="help-block" style="display: none;">
        veuilez rentrer le code affiché sur l'image ci-haut.</span>
        </div>

        <span class="help-block" style="display: none;">Entrer le code de sécurité.</span>
        <button type="submit" class="btn btn-primary btn-lg" style=" background-color:#418D38; display: block; margin-top: 10px;">Envoyer</button>
        </form>


        All those code are located in the same template named contact-template
          • 3749
          • 24,544 Posts
          See if there's anything in the error log at the time you try to send email. If so, paste the message here.
            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
            • 47775
            • 16 Posts
            I don't understand. I try to send a message but i did not receive any message.
            From where i can check whether there is anything in the error log?
              • 3749
              • 24,544 Posts
              On the Manager Top Menu: Reports -> Error Log.
                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
                • 38723
                • 165 Posts
                Couple of things I noticed on brief glance:
                Where is this global setting coming from: [[++emailsender]]
                Also you have 2 backticks at the end of the line which is probably not helping smiley

                Quote from: walidea at Jul 03, 2014, 03:36 AM

                &emailFrom=`[[++emailsender]]``

                The action here should probably be [[~3]]

                Quote from: walidea at Jul 03, 2014, 03:36 AM

                <form role="form" method="post" action="/[[~3~]]">
                  • 3749
                  • 24,544 Posts
                  The emailsender comes form the emailsender System Setting. Check in System -> System Settings to make sure it contains a valid email address. Also, some hosts don't like it if you use an email address from another domain than theirs.

                    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
                    • 47775
                    • 16 Posts
                    i checked the address are similar
                    and i try again but nothing is working
                      • 3749
                      • 24,544 Posts
                      You might try the QuickEmail extra. It's designed to diagnose email problems and if it also doesn't sent email, you know the problem is not in FormIt.

                        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