We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16885
    • 255 Posts
    After a two-year break I’m back to giving MODx a shot, so far only eForm has been ’trouble’. I’ve created an own form, which I’m trying to mail to one of my email addresses, however, nothing is sent nor is the ’thank you page’ populated with any data.

    eForm call:
    [!eForm? &formid=`EmailForm` &subject=`[+subject+]` &to=`[email protected]` &tpl=`Contactformulier` &report=`ContactResponse` &gotoid=`46`!]


    ’Contactformulier’ (template chunk)
    <p class="error">[+validationmessage+]</p>
     
    <form method="post" action="[~[*id*]~]" id="EmailForm">
     
    	<fieldset class="emailform">
    		<input name="formid" type="hidden" value="EmailForm" />
     
    		<div class="row"><label for="cfName">Uw naam:</label>
    		<span class="formw"><input name="name" id="cfName" class="text" type="text" eform="Your Name::1:" /></span></div>
     
    		<div class="row"><label for="cfEmail">Uw E-mail Adres:</label>
    		<span class="formw"><input name="email" id="cfEmail" class="text" type="text" eform="Email Address:email:1" /></span></div>
    		
    		<div class="row"><label for="cfEmail">Uw Telefoonnummer:</label>
    		<span class="formw"><input name="phone" id="cfPhone" class="text" type="text" eform="Phone Number:string:0" /></span></div>
     
    		<div class="row"><label for="cfSubject">Onderwerp:</label>
    		<span class="formw"><input name="subject" id="cfSubject" class="text" type="text" eform="Form Subject::1" /></span></div>
     
    		<div class="row"><label for="cfMessage">Uw Vraag:</label>
    		<span class="formw"><textarea name="message" id="cfMessage" eform="Message:textarea:1"></textarea></span></div>
     
    		<div class="row"><input type="submit" name="contact" id="cfContact" class="button" value="Verstuur bericht" /></div>
     
    	</fieldset>
     
    </form>


    ContactResponse (email template)
    <p>Dit is een bericht verstuurd door via het contact formulier op de website. Details als volgt:</p>
     
    <p>Naam: [+name+]</p>
    <p>Email: [+email+]</p>
    <p>Onderwerp: [+subject+]</p>
    <p>Telefoonnummer: [+phone+]</p>
    <p>Vraag:<br />[+message+]</p>
     
    <p>U kunt op de volgende link klikken om te reageren: <a href="mailto:[+email+]?subject=RE: [+subject+]">[+email+]</a></p>


    The ’Thank you’-page currently only contains [+subject+] as a test, plus some Dutch text I won’t be bothering you guys with. Any pointers would be more than welcome as it’s proving to be difficult to find the cause (as no erorrs are given in the errorlog).
      • 16885
      • 255 Posts
      Hm, somewhat of a ’solution’; as long as I don’t try to mail my own domain, it seems to work, as in send out the email, the [+subject+] etc shortcuts still aren’t replaced on the Thankyou page. Looks like the mail part is a serversided issue.
        • 30223
        • 1,010 Posts
        What happens when you use the &gotoid=`(page-id)` parameter is that the page is redirected to (page-id) page, meaning that the browser starts a whole new request. In the new request the form data is no longer available and thus none of the placeholders work.

        If you want to use form data in your thankyou page, set the &thankyou parameter to a chunk with your thank-you-template instead of using the &gotoid parameter. You can in fact set &thankyou=`(page-id)` to the same page id as you have now for &gotoid. In that case eForm will fetch teh content of that page and use it as the thank-you-template.
          • 16885
          • 255 Posts
          Thanks a lot TobyL, I didn’t read the manual carefully enough, sorry for that wink