Work with Formidable (frm_after_create_entry)
-
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.
- Does this plug-in work with Formidable?
- Have we done something wrong (see below)?
- 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)
Viewing 1 replies (of 1 total)
- The topic ‘Work with Formidable (frm_after_create_entry)’ is closed to new replies.