• Resolved helpfulwebhosting

    (@helpfulwebhosting)


    Background

    We’re trying to get this to work with Formidable, using code that’s almost exactly like the snippet recommended by Formidable themselves in this link

    Our Issue

    Our receiving site isn’t getting anything from the form.

    1. Does this plug-in work with Formidable?
    2. Have we done something wrong (see below)?
    3. How can we get it to work?

    What We Did

    We pasted code into a single snippet in the Snippets plugin. It looks a lot like this, but I have anonymised some of the real URLs and endpoint details.

    add_action('frm_after_create_entry', 'submitFormExternally', 30, 2);
    
    function submitFormExternally($entry, $form_id){
    
    if ($form_id == 2) {
    
        $baseURI = 'https://xxx.xxx/receivePostback/xxx/';
        $endpoint = 'xxxx-xxxx-xxxx-xxxx-xxxx';
        $post_url = $baseURI . $endpoint;
    
        $body = array(
            'Name' => $_POST['item_meta'][8],
            'Last' => $_POST['item_meta'][9],
            'Phone Number' => $_POST['item_meta'][71],
            'Email' => $_POST['item_meta'][10],
            'Please select the product/s you are interested in discussing' => implode(',',$_POST['item_meta'][138]),
            'Terms & Conditions' => $_POST['item_meta'][139],
            'trackingid__sb' => $_COOKIE['__ss_tk']
        );
    
        $request = new WP_Http();
        $response = $request->post( $post_url, array( 'body' => $body ) );
        };
    };

    We chose options to ‘Run snippet everywhere’ and gave it Priority 30, matching what’s in the code.

    All help and advice greatly appreciated, thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter helpfulwebhosting

    (@helpfulwebhosting)

    Quick update – I answered my own question.

    The array labels that were copied from our form labels included characters such as & and /.

    Removing those got it to work.

    Hopefully this topic will help others who fall into the same trap.

Viewing 1 replies (of 1 total)
  • The topic ‘Work with Formidable (frm_after_create_entry)’ is closed to new replies.