zaus / forms-3rdparty-integration

Wordpress Plugin - Forms 3rdparty Integration - a plugin to help integrate 3rdparty services with common WP Forms plugins like Contact Form 7 and Gravity Forms
http://wordpress.org/plugins/forms-3rdparty-integration/
47 stars 14 forks source link

error and Notice i get when i try to send form data to my crm #24

Closed foxpcteam closed 9 years ago

foxpcteam commented 9 years ago

Hi, first thanks for your great work! now for the quasions and the problems. i tried to use this plugin with my crm.

my crm using: REST API method: POST mycrm.mysite.com/api/v1/Lead so i need to Specify field values as JSON in the request payload

after the form is submitted, i get this error: Notice: Undefined index: failure in /home/webic980/public_html/wp-content/plugins/forms-3rdparty-integration-master/plugin-ui.php on line 136

and in the email: SUBMISSION Array ( [timeout] => 10 [body] => Array ( )

)

RAW RESPONSE Array ( [safe_message] => error object [object] => WP_Error Object ( [errors:WP_Error:private] => Array ( [http_request_failed] => Array ( [0] => Not properly address entered. )

            )

        [error_data:WP_Error:private] => Array
            (
            )

    )

)

foxpcteam commented 9 years ago

help?

zaus commented 9 years ago

Sorry for not getting back to you sooner.

To submit JSON, you'll need to write a hook that modifies the post body, similar to how Forms 3rdparty Xpost turns the request into XML. You may even be able to use the same hook with a later priority (> 12) and that plugin if you need to nest elements; just don't return as XML and you can modify the $args['body'] array.

Otherwise you might need to write a bypass hook and construct the post yourself as mentioned in this question.