FreeForm: Gathering User Name and Email from member
Posted: 16 November 2007 06:33 AM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  35
Joined  2007-11-01

FreeForm team,

I’ve been struggling how to properly use freeform and have
has some success while at the same time much frustration.

Problem: Contact Us Form
1. Gather logged in member Name
2. Gather logged in member Email
3. Gather Comment

Report this information back to template to be emailed to client.

If you have any direction or comments please let me know and don’t be afraid of insulting me about my abilities
with freeform and EE, I’m still trying to get my head around it all.

Regards,
Chris

Profile
 
 
Posted: 16 November 2007 07:24 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

If you really wanted to, this exact information can be gathered (and emailed to a client) via the native EE Email Module Contact Form:
http://expressionengine.com/docs/modules/email/contact_form.html

However, you cannot create your own template with it. Freeform would allow you to do such.
Following the Freeform Form documentation, a sample code might look like this:

{exp:freeform:form form_name="choose_a_form_name" send_user_email="yes" user_email_template="some_template" notify="you@yourdomain.com" template="your_notification_template" return="my/template" required="name|email|comments"}

<p>Name<br />
<
input type="text" name="name" value="{logged_in_screen_name}" />
</
p>

<
p>Email<br />
<
input type="text" name="email" value="{logged_in_email}" />
</
p>

<
p>Comments<br />
<
textarea name="comments" cols="50" rows="5"></textarea>
</
p>

<
p>
<
input type="submit" name="submit" value="Submit" />
</
p>

{/exp:freeform:form} 

Make sure you create the “comments” field in the Freeform CP (I believe the name and email fields are there by default… maybe even the comments too).

Also, you will need to create two templates from the Freeform Templates CP

One will be from the parameter user_email_template=“some_template” which will be the template the user will get - name the template whatever you wish, and create it in the Freeform Templates CP. Just follow the steps, and then style the form the way you wish, using {name}, {email}, and {comments} as the variables submitted from the user from the Freeform form.

The other, template=“your_notification_template” is the template that will be sent to you, which would be created the same way as the other one above.

Let me know if you have any futher questions smile

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 17 November 2007 03:19 AM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2005-04-25

The comments field is not there by default, but it’s the first thing I add when setting up Freeform.

Profile
 
 
Posted: 18 November 2007 07:53 PM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2007-11-01

Pie Man,

What can I say - Your always there when I need you and I have learned a tremendous amount from you in the past week.

I went through the code you posted above and it makes sense and all but doesn’t get me to where I need - but almost.

Take a look at this:
http://neednotsay.com/expressionEngine/index.php/contactUs/6_0_contactUs/

My ideal is to forward the logged in information of the member on to my client and track it via Freeform -
but for some reason I just can’t get it to output the what I want.

{exp:weblog:entries weblog="generalPageContent"}
{exp
:freeform:form form_name="contactUs" send_user_email="no" notify="me@neednotsay.com" template="Contact Us" return="contactUs/6_1_thankYou"}
  
<div id="content">
   <
div class="contact-form">
    <
div class="bg">
     <
div class="top-bg">
      <
div class="headline">
       <
strong>NORTHLAND SECURITIES 1031</strong>
       <
h2>Contact Us</h2>
      </
div>
<
input type="hidden" name="name" value="{logged_in_screen_name}" />
<
input type="hidden" name="email" value="{logged_in_email}" />
       <
div class="cont">
              <
p>{contactUs_copy}</p>
        <
div class="form">
         <
label>Comment:</label>
         <
div class="textarea"><textarea name="membersComment" cols="" rows=""></textarea></div>
        </
div>
       </
div>
       <
div class="submit"><input type="image" src="http://neednotsay.com/expressionEngine/images/uploads/form-submit.gif" /></div>
     </
div>
{/exp:freeform:form}
{
/exp:weblog:entries} 

Any suggestions?
Chris

Profile
 
 
Posted: 19 November 2007 11:48 AM   [ Ignore ]   [ # 4 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2005-04-25

What is your game plan if the user *isn’t* logged in?

You’ve posted the source of your form, but not the content of your template.

Profile
 
 
Posted: 19 November 2007 12:28 PM   [ Ignore ]   [ # 5 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2007-11-01

Sue,

The user must be logged into to use the site.

Not sure what you mean by the content for the template. (please advise)

thanx,
chris

Profile
 
 
Posted: 19 November 2007 12:54 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

First things first, you’ll need to add these parameters:

send_user_email=“yes” (will send the user a message)
user_email_template=“some_template” (the template that will be sent to the user)
Documentation: http://www.solspace.com/docs/entry/freeform_25_form_tag/#send_user_email

Secondly, make sure you’re using the Template Name for the template name parameter.

Thirdly, as Sue mentioned, we’ll need to see your Template code (the template within Freeform CP that is triggerred to send to the user - from “user_email_template”)

As sample for the template would look like this:

The following message has been submitted:

Submittal Date: {entry_date}

Name: {name}
Email Address: {email}

Comments:
{membersComment}

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 19 November 2007 02:06 PM   [ Ignore ]   [ # 7 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2007-11-01

Thank you everyone for your assitance and patience - I have it working as I want now.

Much appreciated!!

Profile
 
 
Posted: 20 November 2007 10:45 AM   [ Ignore ]   [ # 8 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2005-04-25
cswenke - 19 November 2007 12:28 PM

Sue,

The user must be logged into to use the site.

Not sure what you mean by the content for the template. (please advise)

thanx,
chris

Ummm… I was able to get to the form you posted without being logged in. You’re going to want to beef up that part of things.

Profile