Hi Ben,
Thanks for the reply, we are getting somewhere with this issue. So far so good the test email works with PhP, and in the actula submission, emails are not sent.
The way I understand this to work is as follows:
1. Registration forms with
2. The thankyou.php file
3. The email configuration in the form tools
Configuration:
Status = enabled
Event trigger = On submission
Recipients:
Custom recipients using the form email field
From:
Custom recipients supply by me
Reply to:
Custom recipients supply by me, save as recipients
Content:
On submission:
The email is sent to the applicant to click a link. On clinking the link, the finalize.php confirms the header for unique_key. After confirmation redirect to another page.
4. The Finalize php
So far, only the test is sending the emails, and with actual submission only the thankyou page and no email is sent.
Is there any event trigger to be added to the emails. I presumed it is not a case of spamming as the test emails are received by the recipients, and clinking the link will open the link page with the unique_key on the header pages.
At what point this function be ft_send_emails("on_submission", $form_id, $submission_id); called and where should it be on submission.php.
Please advised, I know this is painful but this is one of the most important part of the Form Tools, and in fact the killer apps in the system.
Thanks
NB: the link actually is written as unique_key, but showing as nique here.
Thanks for the reply, we are getting somewhere with this issue. So far so good the test email works with PhP, and in the actula submission, emails are not sent.
The way I understand this to work is as follows:
1. Registration forms with
PHP Code:
if (empty($errors))
{
$params = array(
"submit_button" => "Submit",
"next_page" => "newthanks.php",
"form_data" => $_POST,
"send_emails" => true
);
ft_api_process_form($params);
}
// it failed validation. Update $fields with the latest contents of the form data
else
{
$fields = array_merge($_SESSION["form_tools_form"], $_POST);
}
}
?>
2. The thankyou.php file
Code:
<?php
require_once("/home/content/19/6046519/html/formtools/global/api/api.php");
$fields = ft_api_init_form_page("22");
ft_api_clear_form_sessions();
?>
3. The email configuration in the form tools
Configuration:
Status = enabled
Event trigger = On submission
Recipients:
Custom recipients using the form email field
From:
Custom recipients supply by me
Reply to:
Custom recipients supply by me, save as recipients
Content:
Code:
Submission ID:{$SUBMISSIONID} Examination: {$ANSWER_Examinations}
<tr>
<p>
Dear {$ANSWER_title} {$ANSWER_surname},
Thank you for registering with yoursite.com, your registration has been submitted.
Please click this link to complete your registration http://www.yoursite.com/Prefinalise.html?id={$ANSWER_unique_key}
Administration Manager
<p>
</p>
On submission:
The email is sent to the applicant to click a link. On clinking the link, the finalize.php confirms the header for unique_key. After confirmation redirect to another page.
4. The Finalize php
Code:
<?php
require_once("/home/content/19/6046519/html/formtools/global/api/api.php");
if (empty($_GET["id"]) || empty($_GET["key"]))
{
header("location: http://www.yoursite.com/anything.html"); // redirect somewhere...
exit;
}
// here you'll need to replace X with your form ID
$submission_info = ft_api_get_submission(22, $_GET["id"]);
// if the key matches for this submission, finalize it!
if ($submission_info["unique_key"] == $_GET["key"])
{
// replace X here too
$query = mysql_query("
UPDATE {$g_table_prefix}form_22
SET is_finalized = 'yes'
WHERE submission_id = $submission_id
");
// here you could just redirect to a page that tells the submission
// has been approved. Alternatively you could show it below
header("location: http://www.yoursite.com/welcome.html");
exit;
}
?>
So far, only the test is sending the emails, and with actual submission only the thankyou page and no email is sent.
Is there any event trigger to be added to the emails. I presumed it is not a case of spamming as the test emails are received by the recipients, and clinking the link will open the link page with the unique_key on the header pages.
At what point this function be ft_send_emails("on_submission", $form_id, $submission_id); called and where should it be on submission.php.
Please advised, I know this is painful but this is one of the most important part of the Form Tools, and in fact the killer apps in the system.
Thanks
NB: the link actually is written as unique_key, but showing as nique here.