PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_pre_submission_filter not displaying dynamic confirmation message

  1. jcole

    I've created the a custom gform_pre_submission_filter to run upon form submission.

    It calls a function to generate a PDF and should display a custom confirmation message upon success. The generate PDF call works, but the custom confirmation message is not displayed on the results page (it displays the default conformation instead).

    The filter code is as shown:

    add_action("gform_pre_submission_filter_1", "get_ceu_pdf", 10, 2);
    function get_ceu_pdf($form) {
        require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
        if (is_plugin_active('ce-certificates/ce-certificates.php')) {
        	// Set form values
        	$course_id = $_POST['input_5'];
        	$user_id = $_POST['input_4'];
        	$certificate_date = $_POST['input_6'];
            $license_number = $_POST['input_2'];
            $send_email = $_POST['input_7'];  
            // Plugin is activated, generate and email certificate
            $cert_name = ce_generate_certificate($course_id, $user_id, $certificate_date, $send_email);
            // Output confirmation message
            $form["confirmation"]["type"] = "message";
            $html_message = '<div class="ce-message">';
            $html_message .= '<h3>Certificate Issued</h3>';
            if ($cert_name) {
                $html_message .= '<p>You may download the course certificate <a href="'.CE_CERTIFICATES_UPLOAD_URL.$cert_name.'" target="_blank">here</a></p>.<p>Your certificate has also been emailed to chosen user at the provided email.</p>';
            } else {
                // Cert generation failed
                $html_message .= '<strong>Sorry, an error has occurred generating your certificate.</strong>';
            $html_message.= '</div>';
            $form["confirmation"]["message"] = $html_message;
        return $form;

    Should this filter work as coded?


    Posted 6 years ago on Tuesday June 25, 2013 | Permalink
  2. jcole

    Here's the link to the form in question:

    Posted 6 years ago on Tuesday June 25, 2013 | Permalink
  3. handling via priority support.

    Posted 6 years ago on Wednesday June 26, 2013 | Permalink

This topic has been resolved and has been closed to new replies.