Support » Plugin: Forms: 3rd-Party Integration » Show Response In Success Message

  • Hello,

    I have been trying to get the GF confirmation message on success to include the response from the API call.

    Your github’s documentation suggests something like:

    class MyPlugin {
        public function MyPlugin() {
            add_filter('Forms3rdPartyIntegration_service', array(&$this, 'adjust_response'), 10, 2);
        }
    
        public function adjust_response($body, $refs) {
            // use 'attach' to inject to regular email
            // use 'message' to inject to page
            $refs['attach'] = 'custom message in email';
            $refs['message'] = 'custom message on page';
        }
    }
    new MyPlugin(); // attach hook

    Step 1: hook this into the gravity form confirmation hook. Failed by adding this to my function.php

    class MyPlugin_34 {
        public function MyPlugin_34() {
            add_filter('Forms3rdPartyIntegration_remote_success', array(&$this, 'adjust_response'), 10, 2);
        }
    
        public function adjust_response($body, $refs) {
            // use 'attach' to inject to regular email
            // use 'message' to inject to page
            $refs['attach'] = 'custom message in email';
            $refs['message'] = 'hello';
        }
    }
    new MyPlugin_34(); // attach hook
    
    add_action( 'gform_confirmation_1', 'MyPlugin_34::adjust_response', 10, 4 );

    I tried other ways too by looking at the various support threads but had no success.

    Would be awesome if you can point me in the right direction!

    Thank you for your help.
    Tobias

    https://wordpress.org/plugins/forms-3rdparty-integration/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    found the unique hook for successful submission in the plugin admin page.

    add_action('Forms3rdPartyIntegration_service_a0', array(&$this, 'YOUR_CALLBACK'), 10, 2);

    So i took this and your “adjust_response” function as in the github sample to build:

    class MyPlugin {
        public function MyPlugin() {
            add_filter('Forms3rdPartyIntegration_service_a0', array(&$this, 'adjust_response'), 10, 2);
        }
    
        public function adjust_response($body, $refs) {
            // use 'attach' to inject to regular email
            // use 'message' to inject to page
            $refs['attach'] = 'custom message in email';
            $refs['message'] = 'hello';
        }
    }
    new MyPlugin(); // attach hook

    Still no success.

    Once the function and hook is working, could I replace $refs['message'] = 'hello'; with $refs['message'] = $response['body']; to show the response body?

    Thank you for your help!
    Tobias

    Also looking for solution to this – tried the same code, also tried the response_bypass get_override function

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Response In Success Message’ is closed to new replies.