Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Confirmation email sending

Author: Antony Corsten Reference Number: AA-00510 Views: 9956 Last Updated: 03/23/2011 12:33 PM 0 Rating/ Voters
Confirmation email sending

This feature allows to sent email for client confirmation before sending data from the form to you.
This feature is a complex solution. It requires MySQL database.
To make this you will need to create 2 forms.
First form will take user information write to database and send email to user with confirmation link.
User will click confirmation link that will activate second form - it will take user information from database, and send it to you as confirmed data.
Example of form1 config:

#emal confirmation form, part1
[email_confirm_form_1]
page = ../email_confirm_form_1/index.html
page = ../email_confirm_form_1/preview.html
page = ../email_confirm_form_1/thank-you.html

mysql_query = INSERT INTO email_confirm_form (`firstname`,`lastname`,`email`,`subject`,`comment`) VALUES ('{#firstname#}','{#lastname#}','{#email#}','{#subject#}','{#comment#}'); rec_id

email = ../email_confirm_form_1/autoresponder.txt

required_fields = firstname (First Name), email (Contact Email), subject (Subject), comment (Comment)
email_fields = email (Contact Email)


This form takes data (`firstname`,`lastname`,`email`,`subject`,`comment`) and writes it to the database.
Here we use optional second parameter for mysql_query. Action returns id of the record in variable mentioned in second parameter.
In our case id of record will be inserted i {#rec_id#}, we will use this id to restore user data for sending you.
Email template of this form will look like:
To: {#email#}
From: your@address.com
Subject: Submission confirmation

Please follow this link to confirm your submission.
http://yousite.com/path_to_fpp/index.php?fpp_form=email_confirm_form_2&id={#rec_id#}
In this link we pass through get request form name and id of record, so FPP can restore users data and send it.

Here is config of second form. (will load data and send to you).

#emal confirmation form, part2
[email_confirm_form_2]
page = ../email_confirm_form_2/index.html
page = ../email_confirm_form_2/thank.html

mysql_select = SELECT * FROM email_confirm_form WHERE `id` = '{#id#}'

email = ../email_confirm_form_1/autoresponder_confirmed.txt
email = ../email_confirm_form_1/email.txt
is_field_set = id, 1, field 'id' should be passed to form to continue
required_fields = firstname (First Name), email (Contact Email), subject (Subject), comment (Comment)
email_fields = email (Contact Email)
This form will load data from the database with mysql_select action and send email to your (email.txt) and autoresponder to user (autoresponder_confirmed.txt), so the user will know everything is ok.
All will be done automatically and user will be taken to thank you page that will notify him that submission approved.

Here we use action is_field_set , so the form cannot be submitted if id of record was not passed to FPP.