How to create a form that emails the entries plus a passed parameter

gabbyaquino 31 Oct, 2014
Hi!

We are a Travel and Tour agency and we are looking at Chronoforms 5 as a solution to make reservations and inquiries to our packages.

We have created many articles each showing our different packages. At the end of each article, we have created a BOOK NOW button which goes to another article containing the Chronoform Reservation Form.

The form merely asks for the clients name, email, number, date, no, of people plus a message box.

Once the client hits submit, we would like the entries plus the package from the article he came from be emailed to us.

Do you have a sample form for this? Or can you teach us how to do it?

Thanks!
GreyHead 31 Oct, 2014
Hi gabbyaquino,

You don't need to use a second article for the form - you can just link directly to the form page. That might make the next bit easier. If the linking URL contains an identifier like &pack_id=999 then ChronoForms will pick this up and you can add a hidden input to your form with the name pack_id to catch the value.

That might also work using the plug-in in an article - please test and see, if not please re-post and we'll work out a way through,

Bob
gabbyaquino 03 Nov, 2014
Worked like a charm! Thank you very much!

I appended &package_id=samplepackage to the calling Button. And now I can use {package_id} to appear in the email.
How do I save the {package_id} in the db table? I have already created a DB save in the On Success action but it saves the forms entries only.

zo0v6_chronoengine_chronoforms_datatable_reservation This is my table name.
GreyHead 03 Nov, 2014
Hi gabbyaquino,

You need to add a hidden input to your form with the name package_id so that the value is submitted along with the rest of the form data and can then be saved. At present it is only available in the On Load event. ChronoForms should automatically set
the value of the hidden input from the URL.

Bob
gabbyaquino 05 Nov, 2014
Hi...

I added a hidden field to my form with Field Name and Field Id both set to package_id. Is Hidden Field same as hidden input?

And then I added a package_id varchar field type to my mysql table.

In my Setup, I have an On Load event with Load Captcha and HTML (Render Form) already there.

After I tried filling up the form, the package_id field of the mysql table was still empty. Do I need to put a Custom Code in the On Load event or did I miss anything?

Thanks... I'm nearly through.

One final thing. I'd like to use the auto incrementing id field from my mysql table to be the Token No in my form. So this is the reverse of my first request. How do I access the field value in my mysql table and make it appear in my form.

If you can help me with this, we can both have coffee!
GreyHead 05 Nov, 2014
Hi gabbyaquino,

For the first part please click the Delete Cache icon in the Forms Manager toolbar - ChronoForms caches the table/column info for 24 hours.

I'm not sure I fully understand the second question :-( but this FAQ might help?

Note: you can't reliably access a record id until after the record is created.

Bob
gabbyaquino 05 Nov, 2014
It worked! Thanks a lot!

Gabriel, you just completed your payment.

Your transaction ID for this payment is: 4MJ40062SH703082U.
We'll send a confirmation email to gabbyaquino@yahoo.com. This transaction will appear on your statement as PayPal *REVELLJANES.

Enjoy your coffee! Im enjoying mine now!
GreyHead 06 Nov, 2014
Hi Gabby,

Thank you - much appreciated.

Bob
gabbyaquino 20 Nov, 2014
Hi there again!

Here is the site using Chronoform! www.alwantour.com

Please try to go to any Holiday Package and Book a reservation.

The email you use will produce an error saying ...

Mailer Error: The following From address failed: "user@mail.com" : MAIL FROM command failed,550,From address must match authenticated address

However, it seems to be working as I am getting the email.

How do I get rid of this error message?

Thanks!
GreyHead 20 Nov, 2014
Hi Gabby,

Are you using a Dynamic From Email address? If so, don't. Please try a Dynamic Reply To instead and set a Static from that matches the authenticated address.

Bob
This topic is locked and no more replies can be posted.