We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    Can eForm email a series of people, like a tell-a-friend form with 3 email addresses to notify?
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 32963
      • 1,732 Posts
      Quote from: rthrash at Jun 27, 2006, 10:52 AM

      Can eForm email a series of people, like a tell-a-friend form with 3 email addresses to notify?

      Yes it can.

      The trick is to have a hidden fields call email and use Javascript to add your Tell-a-fiend emails to the hidden field:

      [[eForm? &formid=`TellAFriend` &sendirect=`1` &subject=`[+friend+] wants you to see this site`]]
      <form name="tell" method="POST">
      	<input type="hidden" name="formid" value="TellAFriend">	
      	<input type="hidden" name="email" value="[+email+]">	
      	<input type="text" name="friend" size="20" value="[+firned+]">
      	<input type="text" name="tell1" size="20" onchange="updateEmail()">
      	<input type="text" name="tell2" size="20" onchange="updateEmail()">
      	<input type="text" name="tell3" size="20" onchange="updateEmail()">
        	<input type="submit" value="Submit" name="cmdsend">
      </form>
      <script>
      	function updateEmail() {
      		// get form elements
      		var f = document.forms['tell'];
      		var email = f.elements['email'];
      		var t1 = f.elements['tell1'];
      		var t2 = f.elements['tell2'];
      		var t3 = f.elements['tell3'];
      		
      		// store emails 1 to 3 inside an array
      		emails = []; 
      		emails[emails.length] = t1.value
      		if (t2.value) emails[emails.length] = t2.value;
      		if (t3.value) emails[emails.length] = t3.value;
      		
      		// save emails to email field
      		email.value = emails.join(",");
      	}
      </script>
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: Dimmy at Jun 19, 2006, 06:12 AM

        mm thats sound good but dificult could you show me an example or a link?

        Dimmy, this example is a manual form (not using eForm), but is an example of a three part form which is actually one page with the js/css show/hide technique described below.

        Go to:
        http://circleofexperts.com/apply-select-industry.html

        and then choose an industry to load the form for that industry, so you can see the JS/CSS technique. If you fill out the first page, you can see the second page, which actually includes TinyMCE for entering resumes.

        This is a live form, so please don’t post unless you really want to signup for the program... grin
          • 7455
          • 2,204 Posts
          Nice thanks Jason.

          looked ad the source wow wil be a puzzle i think but I wil have alook at this
            follow me on twitter: @dimmy01
            • 25663 MODX Staff
            • 12,272 Posts
            Raymond, a quick follow up, does that send individual mails, or mails to all three at once?
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 32963
              • 1,732 Posts
              Quote from: rthrash at Jun 27, 2006, 03:39 PM

              Raymond, a quick follow up, does that send individual mails, or mails to all three at once?

              It currently sends all at once.

              I guess it would be a good idea to add support for such features in the next version, right? Maybe something like:

              &to=`[+tell1+]|[+tell2+]|[+tell3+]`

              Where the | character can be used to group email addresses. Each group will receive a separate copy of the email. For example:

              &to=`[email protected],[email protected] | [email protected],[email protected] | [email protected]`

              In the above mary and john will recieve one email, paul and pam will recieve another and kim another. Three emails to three separate groups.


                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.
                • 25663 MODX Staff
                • 12,272 Posts
                That would be very good indeed. smiley
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 17705
                  • 501 Posts
                  I wan to use a plain text report, not html
                  just something like this:

                  Nombre: [+nombre+]
                  Teléfono: [+telefono+]
                  e-mail: [+email+]

                  Mensaje:
                  [+mensaje+]

                  But all break lines (^13) are stripped and I receive something like:

                  Nombre: Esteban Teléfono: 4577484 e-mail: testingyahoo.com.ar Mensaje: 654654

                  654654

                  65555555555555 lsdlldlsl


                  only the textarea have line breaks...
                  Is there any way to solve that?
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Quote from: zi at Jun 25, 2006, 11:12 PM

                    Anybody here knows why vericode field is self populating when using eForm parser by TobyL ?

                    Following up on that, here’s an example of a template that is exhibiting this problem:

                        <label> Enter the verification code <b>[+vericode+]</b> below: * <br />
                        <input name="vericode" type="text" size="10" value="" />
                        </label>


                    And here is a link to the page. I think the form parser may be the cause.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 7145
                      • 4 Posts
                      Hi all,

                      I was playing around with the automessage feature and I kept receiving the wrong emails. It turned out that the wrong chunk was loaded:
                      # load autotext template
                      if (strlen($autotext)<50) {
                       if(is_numeric($autotext)) $autotext = ($doc=$modx->getDocument($autotext)) ? $doc['content']:"Document id '$autotext' not found.";
                       else if($autotext) $report = ($chunk=$modx->getChunk($autotext)) ? $chunk:"Chunk '$report' not found.";
                      }

                      I believe $report should be replaced by $autotext.
                      Encountered this tiny bug in multiple versions, don’t know whether it still exists in the latest version or not.

                      PS.
                      eForm is a great snippet, keep up the good work!


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