Adding a new filter for GFSalesforceWebToLead push / send_request
-
I’d like to filter the data before it gets sent to Salesforce, for additional functionality for more complex setups and field mapping.
You could add a $data filter before the ‘send_request’ method gets called in the ‘push’ method of GFSalesforceWebToLead, or a $args filter in the ‘send_request’ method before it gets sent to wp_remote_post. I’d be happy with either.
Please also add a filter for the subdomain or domain itself that gets used in wp_remote_post.
In: SFSalesforceWebToLead::push
$data = array_map('stripslashes', $data); $data = apply_filters( 'gf_salesforce_push_data', $data, $form_meta, $entry ); $result = self::send_request($data);
In: SFSalesforceWebToLead::send_request
// Set SSL verify to false because of server issues. $args = array( 'body' => $post, 'headers' => array( 'user-agent' => 'Gravity Forms Salesforce Add-on plugin - WordPress/'.$wp_version.'; '.get_bloginfo('url'), ), 'sslverify' => false, ); $args = apply_filters( 'gf_salesforce_request_args', $args, $debug ); $sub = $debug ? 'test' : 'www'; $sub = apply_filters( 'gf_salesforce_request_subdomain', $sub, $debug ); $result = wp_remote_post('https://'.$sub.'.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', $args);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding a new filter for GFSalesforceWebToLead push / send_request’ is closed to new replies.