Form Tools
OnSubmission Email - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: OnSubmission Email (/showthread.php?tid=939)



OnSubmission Email - SiburNY - Nov 15th, 2010

I had problem sending auto notification when someone submits a form. But then I found this code:
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 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);
    }

    
header("location: $next_page");
    exit;
  } 

Does it mean that I can only receive emails when I have CAPTCHA and $next_page specified?


RE: OnSubmission Email - Ben - Nov 20th, 2010

Hi SibuNY,

Yes, there needs to be a "next_page" param specified, but no, there doesn't have to be a captcha ($passes_captcha defaults to true).

Do you have a situation where you don't want to define a $next_page?

- Ben


RE: OnSubmission Email - SiburNY - Jan 11th, 2011

Sorry for long delay Smile

For some reason, notification email didn't work when I specified $next_page parameter. So the solution was not to specify it, and then use header("Location: thankyou.php") to redirect to a thank you page.

I'll try to find some time and play around to see why it wouldn't work.

Max

(Nov 20th, 2010, 10:06 AM)Ben Wrote: Hi SibuNY,

Yes, there needs to be a "next_page" param specified, but no, there doesn't have to be a captcha ($passes_captcha defaults to true).

Do you have a situation where you don't want to define a $next_page?

- Ben