Hello, all. I’m new to eForm, MODx and web development in general. I’ve started using eForm and am very impressed. I’ve learned my way through just about all my issues thanks to the docs and this forum but I’m still stuck on one spot.
I’m trying to create a referral form, i.e., where someone can enter several e-mail addresses and a message to refer people to this site. I would like the e-mails generated by eForm to go to these e-mail addresses. How do I do that? The &to does not seem to take form values. I tried using &to=`[+mail1+],[+mail2+]` etc. and &to=`[.mail1],[.mail2]` etc. but they did not work. I even tried labeling all the e-mail address fields with name="email" and then using &sendirect=`1` and that didn’t work.
Here’s a bit of my form:
<form method="post" action="[~[*id*]~]" enctype="multipart/form-data" id="referrals">
<p>* denotes required field</p>
<p style="color:#900;">[+validationmessage+]</p>
<p><label for="fname" >* Your first name:
<input tabindex="1" maxlength="254" size="30" name="fname" type="text" eform="First name:string:1:is a required field. We use it let the recipient know you sent the message." />
</label></p>
<p><label for="lname">* Your last name:
<input tabindex="2" maxlength="254" size="50" name="lname" type="text" eform="Last name:string:1:is a required field. We use it let the recipient know you sent the message." />
</label></p>
<p><label for="smail">* Your e-mail address:
<input tabindex="3" maxlength="254" size="60" name="smail" type="text" eform="Your e-mail address:email:1:is a required field. We include it so the recipient can reply directly to you." />
</label></p>
<p><label for="message">Your message:
<textarea tabindex="4" name="message" cols="60" rows="12">I hope you don’t mind my sending you this link. I’ve found this site very helpful:
http://www.spiritualoutreach.com</textarea>
</label></p>
<h3>Please enter the e-mail addresses of the people you would like to make aware of this site: </h3>
<p><label for="mail1">Person 1:
<input tabindex="5" maxlength="254" size="60" name="mail1" type="text" eform="email1:email:0" />
</label></p>
<p><label for="mail2">Person 2:
<input tabindex="6" maxlength="254" size="60" name="mail2" type="text" eform="email2:email:0" />
</label></p>
<p><label for="mail3">Person 3:
<input tabindex="7" maxlength="254" size="60" name="mail3" type="text" eform="email3:email:0" />
</label></p>
<p><label for="mail4">Person 4:
<input tabindex="8" maxlength="254" size="60" name="mail4" type="text" eform="email4:email:0" />
</label></p>
Here’s my snippet call:
[!eForm? &formid=`referrals` &to=`[+mail1+],[mail2+] &from=`
[email protected]` &tpl=`referrals` &report=`RefMail` &thankyou=`RefThanks` &vericode=`1` &subject=`Referral from [+fname+] [+lname+]` &debug=`1` !]
How do I create such a referral form? Thanks - John
PS - I’d also like to use a form field in the &replyto parameter.