Dec 04, 2008, 01:04 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1] 2 3 ... 23   Go Down
  Print  
Author Topic: [Snippet] eForm - The Electronic form Snippet  (Read 94440 times)
0 Members and 1 Guest are viewing this topic.
xwisdom
Foundation
*
Posts: 1,732



« on: Jan 09, 2006, 09:01 AM »


IMPORTANT!
Download Latest eForm Release..
For support please post your requests in new dedicated eForm Support Forum.

This topic is now closed, please post your support requests in new forums as a new topic.
For more information please read this topic: eForm Documentation and Resources.



Hi Everyone,

I've created this form snippet sometime ago to allow me to easy create web forms and have those forms submitted via email.

The snippet requires a web form and a web report. The webform and report can be easily created using the Rich text editor when creating a Chunk.

To install upzip the eform.zip into the root of your modx website and then point your browser to http://www.yourdomain.com/install, where www.yourdomain.com is the name of your domain.

Features:
* Mobile email
* AutoResponder
* Multiple recipients
* CC and BCC support
* Basic form validation
* File handliing

Usage:
Converts or save a web form into a email or html document
This new document can be sent via email to specified user
Main Features:form mail and save,auto-repond, report generation

   Params:
   &vericode (Optional)
      Enables verification code. The template contain a vericode
      field and a [+vericode+] placeholder

   &formid
      This is a unique id used to identity a form during postbacks
      This is useful in cases where more than one form exists on
      a page

   &to (Optional)
      Email address to send eForm information to
      For multiple receipent separate emails with a comma (,)
      If omitted the site settings email address will be used

   &from (Optional)
      Sets he email address to appear in the From section of the email

   &fromname (Optional)
      Sets the name of the sender in the From section of the email

   &sendirect (Optional)
      This will use the form field called email to supply the
      email address to send the message to.
      Set to 1 to activate send direct. Defaults to 0

   &cc (Optional)
      Same as &email but for Cc:

   &bcc (Optional)
      Same as &email but for Bcc:

   &ccsender (Optional)
      Set to 1 to send the user a copy of the submitted form. Defaults to 0
      eForm will look for the user's email address inside a field called email.

   &subject (Optional)
      Subject to appear in email of datatile
      Can include [.form fields.]. E.g. Purcase Order for [.firstname.] [.lastname.]

   &noemail (Optional)
      Prevents eform from sending emails e.g. no-reply@mydomain.com
      Set to 1 to disable emails. Defaults to 0

   &mailselector (Optional)
      Sets the name of the form field to use as a selector to select
      a single email from the comma (,) delimited emails assigned
      the &to parameter. This selector field will act like a numeric
      index to select an email. It will start at 1 for the first email
      and ends at N for the last email in the list.

      For example:
         &to =`sales@me.com,support@me.com,billing@me.com`
         &mailselector=`topic`

         on the web form the topic fields is actually a dropdown menu.
         when the selects a topic from the list the value 1,2 or 3 will
         be sent to eForm which will then be used to select one of the
         three emails assigned to the &to parameter. This email address
         will be the address used to send the email to.

   &mobile (Optional)
      Mobile email address. This email is used to send a short
      notification message to a mobile device.

   &mobiletext (Optional)
      Text message to send to mobile device
      Can include [.form fields.]. E.g. Order for [.firstname.]

   &gotoid   (Optional)
      document id to load after sending message

   &category (Optional)
      Category ID or name used to categorize eForms.
      If category is not found a new category will beb created
      This will appear in the subject of the email sent to the user

   &keywords (Optional)
      Comma delimited keywords or [.form fields.] used when searching databank
      E.g. [.firstname.], [.lastname.], [.email.]

   &autosender (Optional)
      email to display as sender of the auto-respond message
      e.g. no-reply@mydomain.com

   &automessage (Optional)
      chunk name (non-numeric) or document id (numeric) to use as an auto-responder message
      Can include [form fields]. E.g. [firstname]
      - tags: [form_fields],[postdate]
      - note: eForm will send the auto-respond message to the email address specified
            inside the [email] form field.

   &tpl (Optional)
      chunk name (non-numeric) or document id (numeric) to use as a template
      - tags: [+form_fields+],[+validatemessage+], [+postdate+]
            where form_fields is the name of the field used in a form

   &report (Optional)
      chunk name (non-numeric) or document id (numeric) to use when
      generating reports

   &allowhtml (Optional)
      Set to 1 to allow user to enter html tags. Defaults to 0

   &format (Optional)
      list of form fields that requires server-side validation
      - format: field_name:field_description:field_datatype:field_required
         - field_required: 0 or 1
         - field_datatype:
            string,
            date,
            integer,
            float,
            email,
            file      - for file upload input
            listbox      - for <select> boxes,
            checkbox   - for <input checkbox>
            radio      - for <input radio>,
            html       - will converts \n to <br />
         - Note: for listbox, checkbox, radio  use [.field_name:field_value.] in order to reselect the correct item
      - Example: txtname:Name:string:1,txtage:Age:number:0,txtdob:Date Of Birth:date:0


Basic Examples:
[[eForm?&to=me@mydomain.com&gotoid=1&tpl=orders]]

[[eForm?
   &to=`sales@mysuppliers.com`
   &gotoid=`7`
   &category = `Purchase Order`
   &tpl=`purchase_order`
]]

Example using a contact us form:

[[eForm? &formid=`ContactForm` &to=`sales@me.com` &mailselector=`destination` &tpl=`ContactForm` &report=`ContactReport` &category=`Contact Requests` &format=`destination:Department:string:1,topic:Topic:string:1,name:Name:string:1,email:Email:email:1,message:Message:html:1`]]


For Simple form:
[[eForm? &vericode=`1` &formid=`ContactForm` &to=`sales@me.com` &gotoid=`1` &tpl=`ContactForm` &report=`ContactReport` &category=`Contact Requests` &format=`subject:Subject:string:1,name:Name:string:1,email:Email:email:1,message:Message:html:1`]]


PHP Event Function:
$eFormOnMailSent
   This function is called after email has been sent 

UPDATES: Please check the links below for added/updated features and information:
updated/patched version by original author
eForm Parser MOD by TobyL

Few Important posts about eForm:
http://modxcms.com/forums/index.php/topic,2122.msg34623.html#msg34623
http://modxcms.com/forums/index.php/topic,2122.msg34702.html#msg34702

NEW! A guide on the chunks etc needed for a simple working form by TobyL

Please download latest PHPMailer class

* eform.zip (34.36 KB - downloaded 2393 times.)
« Last Edit: Mar 17, 2007, 05:53 AM by zi » Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #1 on: Jan 09, 2006, 10:58 AM »

small bug in the installer
the "eform.inc.php" is placed in:
assets/snippets/
while the snippet looks in :
assets/snippets/eform/

moved it to that folder now it works
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #2 on: Jan 10, 2006, 09:07 AM »

I've bin playing with this but with no succes
could you make an example package that i could use to see how it all works?

I made a chunk called test in that chunk a simple form:
Code:
<form name="test" method=POST action="" >
<input type="file" name="file" size="16">
<p><input type="text" name="Email" size="24">e-mail</p>
<p><input type="text" name="name" size="24">naam</p>
<p><input type="submit" name="submitButtonName"></p>
</form>

and called the snippet like this:
Code:
[[eForm? &to=`mymailadres.com` &gotoid=`3` &tpl=`test` &formid='test']]
it doesn't go to page 3 ider it stay's on the current page
no error nothing

it does show the form

what do i do wrong?

the mail never hits my mailbox
« Last Edit: Jan 10, 2006, 09:10 AM by Dimmy » Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
xwisdom
Foundation
*
Posts: 1,732



« Reply #3 on: Jan 12, 2006, 08:03 AM »

Quote from: Mod note: A bunch of short posts have been combined into one to make this thread easier to follow
xwisdom: Hmmmm, Is the page cached?
Dimmy: nope not cached
xwisdom: Did you set the &formid parameter?
Dimmy: &formid=`test` named the form in the chuck test or is this not the meaning of the formid?

Here's what &formid does
Quote
&formid - This is a unique id used to identity a form during postbacks. This is useful in cases where more than one form exists on a page

Inside your form add
<input type="hidden" name="formid" value="MyForm" />

In your document add

[[eForm?formid=`MyForm` &to=`me@me.com`]]

Here's an example of a contact us form:

Code:
<style>
.contactform tr td {
font-family:verdana,arial;
font-size:13px;
padding:1px;
}
.contactform input, .contactform textarea {
border:1px solid silver;
}
</style>
<form method='post'>
<input type="hidden" name="formid" value="ContactForm">
<div class="contactform">
<table border="0" style="width:inherit">
  <tr>
    <td>Enter your information below then click the
    Send button <font color="#008000"> <br>
    </font><font color="#FF0000" size="1">*</font><font color="#808080"><span style="font-size: 9pt"> -
    Indicates Required fields</span></font></td>
  </tr>
  <tr>
    <td>
<table border="0">
  <tr>
    <td><span style='color:red'>[+validationmessage+]</span></td>
  </tr>
  <tr>
    <td><b>Your name:</b> <font color="#FF0000" size="1">*</font><br />
          <input size="32" name="name" value="[+name+]"><br />
  <b>Email address:</b> <font color="#FF0000" size="1">*</font><br />
          <input size="32" name="email" value="[+email+]"><br />
          <b>Subject:</b><br />
          <input size="32" name="subject" value="[+subject+]"><br />
          <b>Messages:</b> <font color="#FF0000" size="1">*</font><br />
          <textarea name="message" rows="8" cols="37">[+message+]</textarea><br />
          Enter the verification code <b>[+vericode+]</b> below: <font color="#FF0000" size="1">*</font><br />
          <input name="vericode" type="text" size="10" />
          </td>
  </tr>
  <tr>
    <td>
    <table border="0" width="100%">
      <tr>
        <td align="right" width="100%"><input type='submit' name='cmdsend' value='Send' title='Submit form' />&nbsp;
<input type='reset' name='cmdclear' value='Clear' title='Clear form' /></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</td>
  </tr>
  </table>
</div>
</form>

Here's the eForm code:

Code:
[[eForm? &vericode=`1` &formid=`ContactForm` &to=`sales@me.com` &gotoid=`1` &tpl=`ContactForm` &report=`ContactReport` &category=`Contact Requests` &format=`subject:Subject:string:1,name:Name:string:1,email:Email:email:1,message:Message:html:1`]]
« Last Edit: Sep 13, 2006, 10:14 AM by PaulGregory » Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #4 on: Jan 16, 2006, 04:29 PM »

Ok thanks , lots of options to use. I ts not 100 clear to me yet but I get there, is it also easy to use a file upload input field?
would i need to add [+file+] or somthing like that in the chunk as valeu for file?
and what do I add in the snippet call for the snippet to handle the file upload?

Thanks for the help so far

Dimmy
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
xwisdom
Foundation
*
Posts: 1,732



« Reply #5 on: Jan 16, 2006, 06:12 PM »

Try this:

In your form template use:
Quote
<form method="post" enctype="multipart/form-data">
<input name="formid" type="hidden" value="MyForm"/>
<input name="myfile" type="file" size="28"  />
</form>

In your report template use:
Quote
[+myfile+]

And in your web page use:
Quote
[[eForm? &formid=`MyForm` &tpl=`myform` &report=`myreport` &to=`me@domain.com` &format=`myfile:File upload:file:0`]]
Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #6 on: Jan 17, 2006, 03:54 AM »

OK nice
The file does hit my mailbox but as raw text not as an atachment (this is in outlook) in my webmail it is an atachment will try oulookexpress now.

Outlook mail atached here:

* outlook.txt (105.29 KB - downloaded 609 times.)
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #7 on: Jan 17, 2006, 04:22 AM »

OK found the solution

I just updated the PHPMailer class to 1.73 and it work like a charm
Thanks for all the help

* phpmailer-1.73.zip (87.69 KB - downloaded 780 times.)
« Last Edit: Sep 13, 2006, 10:17 AM by PaulGregory » Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #8 on: Jan 17, 2006, 04:28 AM »

Does it also chek if there is an input?
like if i would ask for an mail adres I like it to be validated if there is an input at all.

I have a complex form with some requierd fields, would be nice if the snippet checks for requierd fields and give an error if not all are filled in.

Dimmy
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
xwisdom
Foundation
*
Posts: 1,732



« Reply #9 on: Jan 17, 2006, 05:14 PM »

Sure it does. see the &format parameter
Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #10 on: Jan 19, 2006, 06:40 AM »

It works like a charm Thanks a lot
made this form wth it:
http://www.aladna.nl/index.php?id=7

all i need to do now is creating / changing the language for the error and the thank you.

Nice work thanks
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
rthrash
Foundation
*
Posts: 9,575



WWW
« Reply #11 on: Jan 19, 2006, 09:03 AM »

Hey Dimmy, can you give us a quick run-through as to the calls and how you built that form, and what happens on submit? Thanks!
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #12 on: Jan 19, 2006, 09:58 AM »

ok here it comes:

this is my form a chuck called myform:

Code:
<span style='color:red'>[+validationmessage+]</span>
<form method="post" enctype="multipart/form-data">
<input name="formid" type="hidden" value="MyForm"/>

<table width="316" border="0" cellspacing="2" cellpadding="0">
<tr>
<td colspan="4">
<h3>Gegevens aanvrager</h3>
</td>
</tr>
<tr>
<td colspan="2">Bedrijf*</td>
<td colspan="2"><input type="text" name="bedrijf" value="[+bedrijf+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Contactpersoon*</td>
<td colspan="2"><input type="text" name="contact" value="[+contact+]" size="31"></td>
</tr>
<tr>
<td colspan="2">E-Mail*</td>
<td colspan="2"><input type="text" name="email" value="[+email+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Website http://</td>
<td colspan="2"><input type="text" name="website" value="[+website+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Telefoonnummer</td>
<td colspan="2"><input type="text" name="telefoon" value="[+telefoon+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Faxnummer</td>
<td colspan="2"><input type="text" name="fax" value="[+fax+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Adres</td>
<td colspan="2"><input type="text" name="adres" value="[+adres+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Postcode / Plaats</td>
<td><input type="text" name="postcode" value="[+postcode+]" size="8" maxlength="6"></td>
<td><input type="text" name="plaats" value="[+plaats+]" size="15"></td>
</tr>
<tr>
<td colspan="4">
<address>*verplicht invulveld</address>
</td>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="3">Hoe heeft u ons gevonden?</td>
<td><select name="gevonden" size="1">
<option selected value="Niets geselecteerd">Selecteer</option>
<option value="Telefoongids">Telefoongids</option>
<option value="goudengids">Gouden Gids</option>
<option value="internet">Internet</option>
<option value="anders">Anders</option>
</select></td>
</tr>
<tr>
<td></td>
<td></td>
<td>Anders:</td>
<td><input type="text" name="anders" value="[+anders+]" size="15"></td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="4">
<h3>Gegevens vertaal opdracht</h3>
</td>
</tr>
<tr>
<td colspan="2">Omvang</td>
<td colspan="2"><input type="text" name="omvang" value="[+omvang+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Onderwerp</td>
<td colspan="2"><input type="text" name="onderwerp" value="[+onderwerp+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Brontaal*</td>
<td colspan="2"><input type="text" name="brontaal" value="[+brontaal+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Doeltaal*</td>
<td colspan="2"><input type="text" name="doeltaal" value="[+doeltaal+]" size="31"></td>
</tr>
<tr>
<td colspan="2">Levertermijn</td>
<td colspan="2"><input type="text" name="levertermijn" value="[+levertermijn+]" size="31"></td>
</tr>
<tr>
<td colspan="4">
<address>*verplicht invulveld</address>
</td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="4">
<h3>Opmerkingen</h3>
</td>
</tr>
<tr>
<td colspan="4"><textarea name="opmerkingen" rows="4" cols="40">[+opmerkingen+]</textarea></td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="4">Voeg hier tekst(en) bij (.txt, .doc, .pdf, .rtf)</td>
</tr>
<tr>
<td colspan="2">Bestand 1</td>
<td colspan="2"><input type="file" name="file1" size="16"></td>
</tr>
<tr>
<td colspan="2">Bestand 2</td>
<td colspan="2"><input type="file" name="file2" size="16"></td>
</tr>
<tr>
<td colspan="2">Bestand 3</td>
<td colspan="2"><input type="file" name="file3" size="16"></td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<input type="submit" name="Verzenden" value="Verzenden"></div>
</td>
<td></td>
<td>
<div align="right">
<input type="reset" value="Wissen"></div>
</td>
</tr>
</table>
</form>

the i got chuck thats a template for formatting the mail called myreport:
Code:

[+file1+]
[+file2+]
[+file3+]
<table width="316" border="0" cellspacing="2" cellpadding="0">
<tr>
<td colspan="4">
<h3>Gegevens aanvrager</h3>
</td>
</tr>
<tr>
<td colspan="2">Bedrijf</td>
<td colspan="2">[+bedrijf+]</td>
</tr>
<tr>
<td colspan="2">Contactpersoon</td>
<td colspan="2">[+contact+]</td>
</tr>
<tr>
<td colspan="2">E-Mail</td>
<td colspan="2">[+email+]</td>
</tr>
<tr>
<td colspan="2">Website http://</td>
<td colspan="2">[+website+]</td>
</tr>
<tr>
<td colspan="2">Telefoonnummer</td>
<td colspan="2">[+telefoon+]</td>
</tr>
<tr>
<td colspan="2">Faxnummer</td>
<td colspan="2">[+fax+]</td>
</tr>
<tr>
<td colspan="2">Adres</td>
<td colspan="2">[+fax+]</td>
</tr>
<tr>
<td colspan="2">Postcode / Plaats</td>
<td>[+postcode+]/</td>
<td>[+plaats+]</td>
</tr>
<tr>
<td colspan="4">
</td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="3">Hoe heeft u ons gevonden?</td>
<td>[+gevonden+]</td>
</tr>
<tr>
<td></td>
<td></td>
<td>Anders:</td>
<td>[+anders+]</td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="4">
<h3>Gegevens vertaal opdracht</h3>
</td>
</tr>
<tr>
<td colspan="2">Omvang</td>
<td colspan="2">[+omvang+]</td>
</tr>
<tr>
<td colspan="2">Onderwerp</td>
<td colspan="2">[+onderwerp+]</td>
</tr>
<tr>
<td colspan="2">Brontaal*</td>
td colspan="2">[+brontaal+]</td>
</tr>
<tr>
<td colspan="2">Doeltaal*</td>
<td colspan="2">[+doeltaal+]</td>
</tr>
<tr>
<td colspan="2">Levertermijn</td>
<td colspan="2">[+levertermijn+]</td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
<tr>
<td colspan="4">
<h3>Opmerkingen</h3>
</td>
</tr>
<tr>
<td colspan="4">[+opmerkingen+]</td>
</tr>
<tr height="19">
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
<td height="19"></td>
</tr>
</table>

and this is the snippet call:
Code:
[[eForm?&formid=`MyForm` &tpl=`myform` &report=`myreport` &to=`d.hilverda@tidestream.com` &format=`bedrijf:Bedrijf:string:1,contact:Contactpersoon:string:1,
email:Email:email:1,brontaal:Brontaal:string:1,doeltaal:Doeltaal:string:1,
file1:Bestand 1:file:0,file2:Bestand 2:file:0,file3:Bestand 3:file:0`
&subject=`Vertaalopdracht van [+contact+] van [+bedrijf+]` ]]

snippetcall easyer to read:
Code:
[[eForm? //snippet name...

&formid=`MyForm` //formname see this line in the myform chunk "<input name="formid" type="hidden" value="MyForm"/>"

&tpl=`myform` //template name of the chunk that holds the form in my case the chunk is called myform not to confuse with the form id MyForm.

&report=`myreport` //this is the chuck that contains the mail template as you see above.

&to=`d.hilverda@mymailadres.com` //mail adres...

&format=` //this part does the verivication and tels the class what to do with it.

bedrijf:Bedrijf:string:1, //"bedrijf" = input name, "Bedrijf" is what the class will say when this input is not filled in e.g. [color=red]Bedrijf is required [/color], "string" is to tell the class what kind of input he is dealing with, the 1 means that the class needs to validate the input (0 will not be validated)

contact:Contactpersoon:string:1,
email:Email:email:1,
brontaal:Brontaal:string:1,
doeltaal:Doeltaal:string:1,

file1:Bestand 1:file:0, //for the class to mail the files they need to be in here the 0 indicates that its not a requierd field, instead of "string" I used "file" for the class to know its a file to be atached.

file2:Bestand 2:file:0,
file3:Bestand 3:file:0`

&subject=`Vertaalopdracht van [+contact+] van [+bedrijf+]` //This sets the Subject and uses 2 inputs with it. (in the explenation in the first treat it says to use [.placeholder.] that did not work for me [+placeholder+] did the trick)
only inputs that you want to be requierd and files are needed to be in the snippetcall the rest of the fields wil be picked up by the class en put in the mailtemplate ("myreport")

]]

I hope its understandible this way.
Try it make sure you use the latest PHPmailerClass or file upload will not work.

[edit] this overflow:hidden or somthing like this on the code space is nasty... had to reformat the thing to make all text visible with snippetcals this long it wil never break to a next line... [/edit]
Greets Dimmy
« Last Edit: Jan 19, 2006, 10:15 AM by Dimmy » Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
Dimmy
Testers
*
Posts: 1,824


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #13 on: Jan 20, 2006, 02:02 AM »

is it posible to use the email in the form as the sender of the mail?
that way it is easy to reply to a mail, I tryed [+email+] but that did not work.
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
xwisdom
Foundation
*
Posts: 1,732



« Reply #14 on: Jan 22, 2006, 10:27 AM »

This version does not supoort such a feature but the snippet can be modified to include a reply-to header inside the mail.
Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Pages: [1] 2 3 ... 23   Go Up
  Print  
 
Jump to: