The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Emails not sent unless next_page populated even if finalize. - 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: Emails not sent unless next_page populated even if finalize. (/showthread.php?tid=652)



Emails not sent unless next_page populated even if finalize. - spcjak7221 - Apr 14th, 2010

bug fix: api.php: ft_api_process_form: line 846

I'd like to display a message without redirecting upon a successful form submission but the notification emails aren't sent unless the "next_page" variable is populated forcing a redirect.

Before
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;
  }

After
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;
    }
    
  }



RE: Emails not sent unless next_page populated even if finalize. - Ben - Apr 18th, 2010

Excellent, thanks spcjak7221!

I've logged this as a bug and will address it in the next version of the API.
http://bugs.formtools.org/index.php?cmd=view&id=220

- Ben


RE: Emails not sent unless next_page populated even if finalize. - halles - Jun 15th, 2010

Excelent find. I was just having an issue with this and was going crazy thinking it was my mistake Smile

For the record, the fix works.

Many Thanks!