cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS Related Topics
Examples of multi-part form email notification variables
February 1, 2010
5:07 am
Guest

First, I want to thank Oliver for the excellent plugin. It's very flexible and solid. Second, I wanted to post some info about how I solved my problem with getting variables to work in the notification messages on my multi-part form.

I have a 3-form series I built. I wanted to pass field values from the 1st form in the notification email of the 3rd. I will use the field name "First Name" as an example:

From reading the help, I originally tried this:

{First Name}

I ended up with "{First Name}" in my email.

I spent quite a while trawling through the messages on here, and tried every permutation I could think of. Nothing worked. So I came across this message:

http://www.deliciousdays.com/cforms-forum/troubles…..38;ret=all

I will quote the relevant part from Oliver:

for multi-part forms, this would be the correct way to reference fields on previous forms:

{cf_form_Email} >> field "Email" on form #1

{cf_form2_URL} >> field "URL" on form #2

etc.

If you want to see the complete user data array (as it is used internally), uncomment the cforms "user action" function in my-functions.php and have it send you via email the data array (example is in the file).

So I opened my-functions.php and uncommented lines 37-139. Additionally, I uncommented line 44: @mail('your@email.com', 'cforms my_action test', print_r($cformsdata,1), 'From: your@email.com');

Filling in my email where it says 'your@email.com'.

I tried my form again, and received several messages with the data array listed in them. And I was able to see that the correct way to list the variables was like this:

{cf_form[form number counting from 1]_Field Name}

So for my field, which has the field name "First Name", on the second form in the system (first form is the default form), the variable looked like this:

{cf_form2_First Name}.

When I needed to pull a field named "Total Donation" from form 3, the variable looked like so:

{cf_form4_Total Donation}

I'm sharing this in the hopes its helpful to someone, since I just spent 5 hours trying to figure it out. Oliver, I would maybe put a note in your documentation saying specifically what the difference between single and multi-form variable naming is.

Thanks,

Gustavo

February 3, 2010
7:07 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Excellent post, I think one of my favorites of all.

Thanks for following up!

ps. there is a hint in the documentation under "Multi page forms", but I agree it could be a bit more detailed…

February 10, 2010
4:39 pm
Tom
Guest

Great post Gustavo!

I spent 3 hours trying to figure out the exact same thing until I found this post!

Oliver – Thanks for an amazing plugin and for all of your effort!

If possible you should consider editing the documentation under "Multi page forms" to let people know that when working with custom variables for auto confirmation emails they must reference the actual form number as it appears in the 'Navigate to' box at the top of the Form Settings Page NOT the sequence number of the multi form.

Example: I have created a total of 7 custom forms within cforms. The last 3 forms are a multi form.  If I want a custom variable from the 3rd form in my multi form to display in an auto confirmation email I need to reference it as {cf_form7_'actual field name'} and NOT {cf_form3_'actual field name'}

I am sure this was obvious to most peole but for some of the newbies it may be helpful lol

February 10, 2010
7:35 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Thanks for the heads up.

Straight from the Help! page:

  • Accessing  {custom variables}  in the final form differs from how you would reference these in individual forms. Use the  mail()  example in my-functions.php to examine the user data array; e.g. {Email} would become {cf_form_Email}  (for the first form of the series).
  • File attachments will not be included in the admin email unless the upload fields are on the last form. However, they will be stored and tracked.

but i agree i could probably add an example for subsequent forms…

5996 answers, 3 more to go

March 1, 2010
4:17 am
Michael Grodsky
Guest

Regarding multi-forms sending an auto-confirm email with the person's name properly showing:

Thanks for the insight, Gustavo and Oliver!  However, I still am not able to receive an email with First Name field displayed properly. My First Name field is in form 1. I have "use custom IDs" checked in the Core Admin options for both form #1 and the last form in the series (which is form 6).  I don't know if the "use custom IDs" checkbox matters only in the form that contains the desired variable (form 1) or in the last form that also has the Auto-Confirmation enabled, or if it should be checked in every form. I enabled the checkboxes in  both first and last forms.

Next, in the Auto Confirmation panel of the last form, I have put this text for the person filling out the form to receive: Dear {cf_form1_First Name}, etc.

For Admin Email Message Options, the subject line goes like this: Form from {cf_form1_First Name} {cf_form1_Last Name}

In both examples, when received, the auto-confirmation and admin emails have just the variable listed instead of the actual name of the person. I have tried to follow exactly what boxes should be checked in the first and last forms. Plus I have tried it using just a two-page multi-form, just to keep it simple: same result.

To summarize: I am receiving the auto confirm and admin emails OK, but with the person's name missing from the greeting to the form filler, and in the admin email subject line. Here is the location of my form: http://contacthigh.net/ais/gys…..ire-start/

Oliver said:

Thanks for the heads up.

Straight from the Help! page:

  • Accessing  {custom variables}  in the final form differs from how you would reference these in individual forms. Use the  mail()  example in my-functions.php to examine the user data array; e.g. {Email} would become {cf_form_Email}  (for the first form of the series).
  • File attachments will not be included in the admin email unless the upload fields are on the last form. However, they will be stored and tracked.

but i agree i could probably add an example for subsequent forms…

5996 answers, 3 more to go

March 3, 2010
8:34 pm
Guest

Michael, I'm having problems getting my multipage form to email the admin (me), and to have the form just showing up if it has a parent page (so, in a subdirectory). Can you contact me off-list, please? I've posted to the forum, but not getting any responses. nmrose@verizon.net

March 9, 2010
11:33 pm
Guest

So what would be the recomendation if you have multiple forms for a form series.  For example, I have several 'first page' forms which act as a first form (landing page) from various sources.  By the time I get to the last page of the form, I cant use the variable {cf_form12_Company Name} because sometimes it is form 6 and sometimes it is form 8, etc.  So, many first pages lead into the same last page.

I guess a work around would be to put the field I want to include in the subject of the email on the second form of the series, but before I go re-arranging all my form data, I thought I would ask.

July 27, 2012
10:45 pm
kellyrnh
Guest

Just wanted to add this in case someone else has this problem:

My variable from the first form wasn't working, and I couldn't figure out why. Following everyone's example, I was using: {cf_form1_First Name} and nothing. Then, reading the help section of cforms again under the multipage forms section, I realized the first form doesn't require a number, so should look like this: {cf_form_First Name}. After I did that it worked great. Hope it helps someone!

Great plugin, thanks!!

February 11, 2013
7:14 pm
marcolo
Guest

hi Oliver,

i would display data inserted in the previous form in the second form of a series..

 

what i have to write in the Default value?

thanks alot you are the best! sf-confused

May 14, 2014
1:07 am
jensenworks
Guest

kellyrnh said
Just wanted to add this in case someone else has this problem:

My variable from the first form wasn't working, and I couldn't figure out why. Following everyone's example, I was using: {cf_form1_First Name} and nothing. Then, reading the help section of cforms again under the multipage forms section, I realized the first form doesn't require a number, so should look like this: {cf_form_First Name}. After I did that it worked great. Hope it helps someone!

Great plugin, thanks!!

That is exactly what I needed to see! Thank you.

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3735

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5336

Posts: 18700

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)