Apr 22nd, 2012, 9:31 PM
Thank you!
(Apr 4th, 2012, 4:13 AM)sethta Wrote: For those who have asked exactly what I did, here's the answer. Using 2.2.2 and the API, my issue was that I had the page set up to stay on the current page rather than setting a next_page variable.
It appears that the form will still submit, but if no next_page variable is set, no emails will be sent. The fix is to either set to variable, or apply the following fix to the core (just make sure you remember what it is when you have to upgrade).
FORM_TOOLS_DIRECTORY/global/api/api.php: LINE 866
Before:
PHP Code:if ($passes_captcha && !empty($next_page) && !$is_deleting_file)
{
// if the user wasn't putting through a test submission or initializing the form, we can send safely
// send emails at this juncture, but ONLY if it was just finalized
if ($form_id != "test" && $submission_id != "test" && !isset($_SESSION[$namespace]["form_tools_initialize_form"])
&& !isset($form_data["form_tools_ignore_submission"]))
{
// send any emails attached to the on_submission trigger
if ($is_finalized == "yes")
ft_send_emails("on_submission", $form_id, $submission_id);
}
header("location: $next_page");
exit;
}
return array(true, "");
After:
PHP Code:if ($passes_captcha && !$is_deleting_file)
{
// if the user wasn't putting through a test submission or initializing the form, we can send safely
// send emails at this juncture, but ONLY if it was just finalized OR if the send_emails parameter
// allows for it
if ($form_id != "test" && $submission_id != "test" && !isset($_SESSION[$namespace]["form_tools_initialize_form"])
&& !isset($form_data["form_tools_ignore_submission"]))
{
// send any emails attached to the on_submission trigger
if (isset($params["send_emails"]) && $params["send_emails"] === true)
ft_send_emails("on_submission", $form_id, $submission_id);
else if ($is_finalized == "yes" && (!isset($params["send_emails"]) || $params["send_emails"] !== false))
ft_send_emails("on_submission", $form_id, $submission_id);
}
if(!empty($next_page))
{
header("location: $next_page");
exit;
}
}
return array(true, "");
The fix makes it so the form will send emails, even if there is no next_page variable set by modifying the if statements.
A special thanks to this post earlier for helping me troubleshoot this: http://forums.formtools.org/showthread.php?tid=652
I hope this helps any one else who's having the issue.