This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:extensions:coreboswswebform [2014/07/28 11:14] joebordes [Configuration and Usage] |
en:extensions:coreboswswebform [2018/02/11 08:57] (current) |
||
---|---|---|---|
Line 86: | Line 86: | ||
The [[https://github.com/tsolucio/coreBOSwsWebform|GitHub repository]] has a [[https://github.com/tsolucio/coreBOSwsWebform/blob/master/test.php|test file]] which you can use as a starting point for your project. | The [[https://github.com/tsolucio/coreBOSwsWebform|GitHub repository]] has a [[https://github.com/tsolucio/coreBOSwsWebform/blob/master/test.php|test file]] which you can use as a starting point for your project. | ||
+ | |||
+ | ===== Videos ===== | ||
+ | |||
+ | {{youtube>gv0NV95iOPo}} | ||
+ | |||
+ | ===== Questions and Answers ===== | ||
+ | |||
+ | ~~QNA~~ | ||
+ | |||
+ | ??? I am using Gravity Forms hook, and it sends the field value not the full form data. So when your script parses it doesn't accept the value because its trying to find something else. | ||
+ | |||
+ | https://www.gravityhelp.com/documentation/article/gform_after_submission/#2-send-entry-data-to-third-party | ||
+ | |||
+ | !!! Do this: | ||
+ | |||
+ | <code PHP>add_action( 'gform_after_submission', 'post_to_third_party', 10, 2 ); | ||
+ | function post_to_third_party( $entry, $form ) { | ||
+ | require_once('WsWebform.php'); | ||
+ | $config = array(...); // define your config array here to connect | ||
+ | $webform = new WsWebform($config); | ||
+ | $body = array( | ||
+ | 'first_name' => rgar( $entry, '1.3' ), | ||
+ | 'last_name' => rgar( $entry, '1.6' ), | ||
+ | 'message' => rgar( $entry, '3' ), | ||
+ | ); | ||
+ | $webform->send($body); | ||
+ | // check for errors | ||
+ | }</code> |