Docs. That’s good news. I’m a newbie here, too. Here’s what I’ve learned so far (many thanks to SISU, too for the Go For It encouragement). I’ve written docs, before, so consider this my payPal contribution.
Get started by creating a form.
Freeform allows you to store information submitted via forms, but at its simplest, you can create a form that will be emailed to you.
This example takes a basic contact form with name, email address, phone number, and adds to it.
This example takes the basic EE email module’s contact form and expands on that (The EE mail module, contact form is documented here).
Here is sample EE code for a basic contact form: This is what you’d put in an EE template:
{exp:email:contact_form user_recipients="false" recipients="name@address.com" charset="utf-8"}
<p>
I'd like to know more. Please contact me about your services.
</p>
<label for="name">Name</label>
<input type="text" name="name" id="name" />
<label for="from">Email</label>
<input type="text" name="from" id="from" />
<label for="message">Phone (with area code)</label>
<input type="text" name="message" id="message" />
<input type="hidden" name="subject" value="Contact Via Web Site " />
<p>We will not share your info with anyone. Period.</p>
<input name="Submit" type="submit" value="submit" />
{/exp:email:contact_form}
What do you need to change to adapt it for Freeform?
Change the opening and closing tags from { exp:email:contact_form } to { exp:freeform:form }
In the opening freeform tag, here’s what else you need to do:
1. Add a form name. I’ll call mine site_lead since this is a lead generated from the web site.
2. Who gets the email? change “recipients” to “notify”
In the body of the form, you need to make some changes. Freeform comes with more pre-defined form fields. Check out the list of options in the Control Panel:
Control Panel > Modules > Freeform > Fields Tab.
All the fields are available for this name/email/phone number contact form.
1. “name” stays the same
2. “from” (EE) changes to “email” (FF)
3. “message” (EE) changes to “phone1” (FF)
4. Oh yeah. You can take out that hidden form field “subject”—it was required for EE, but Freeform works differently.
Here is the new (adapted) Freeform template:
{exp:freeform:form form_name="site_lead" required="name|email|phone1" notify="name@address.com" template="default_template"}
<p>
I'd like to know more. Please contact me about your services.
</p>
<label for="name">Name</label>
<input type="text" name="name" id="name" />
<label for="email">Email</label>
<input type="text" name="email" id="email" />
<label for="phone1">Phone (with area code)</label>
<input type="text" name="phone1" id="phone1" />
<p>We will not share your info with anyone. Period.</p>
<input name="Submit" type="submit" value="submit" />
{/exp:freeform:form}
Save the template, preview the page, fill out the form, and click the submit button.
Here’s the default email that was sent:
Subject Line: Someone has posted to Freeform
Someone has posted to Freeform. Here are the details:
Entry Date: 2008-05-23 12:18 AM
Attachments: 0
Form Name: site_lead
Name: Mortimer Schnerd
Email: senderemail@someaddress.com
Phone 1: 800.000.0000
Let’s create a new template and customize it to compose a better email notification
1. Click the Templates tab in the Freeform module.
All that’s there is the default template. You can’t change it, so instead…
2. Click the Create New Template button.
The page refreshes to display a form for you to adapt (My markings in bold; remove spaces between brackets):
Template Name (single_word_no_spaces!): contact_form
Template Label: (can have spaces): Contact Form
From Name: (Name of sender): { name }
From Email: (Email of sender): { email }
Email Subject Line: Web Site Response: Request for more info
Word Wrap and HTML (choose how you want to receive email)
Email Message:
{name} has requested more info about the company.
Here are the details:
Date of request: {entry_date}
Name: {name}
email address: {email}
Phone number: {phone1}
3. Save the template.
4. Now, put the template name (contact_form) into the contact form template. Here’s the altered first line of the freeform opening tag:
{exp:freeform:form form_name="site_lead" required="name|email|phone1" notify="name@address.com" template="contact_form" }
There you go. Friendlier, more customized email notification. That should get you started.