WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Forms: 3rd-Party Integration

Send contact form submissions from plugins CF7 or GF to multiple external services e.g. CRM. Configurable, custom field mapping, pre/post processing.

Hooks

Please note that this documentation is in flux, and may not be accurate for latest rewrite 1.4.0

  1. add_action('Forms3rdPartyIntegration_service_a#', $response, $param_ref);
    • hook for each service, indicated by the # - this is given in the 'Hooks' section of each service
    • provide a function which takes $response, &$results as arguments
    • allows you to perform further processing on the service response, and directly alter the processing results, provided as array('success'=>false, 'errors'=>false, 'attach'=>'', 'message' => '');
      • success = true or false - change whether the service request is treated as "correct" or not
      • errors = an array of error messages to return to the form
      • attach = text to attach to the end of the email body
      • message = the message notification shown (from CF7 ajax response) below the form
    • note that the basic "success condition" may be augmented here by post processing
  2. add_action('Forms3rdPartyIntegration_service', $response, $param_ref, $sid);
    • same as previous hook, but not tied to a specific service
  3. add_filter('Forms3rdPartyIntegration_service_filter_post_#, ...
    • hook for each service, indicated by the # - this is given in the 'Hooks' section of each service
    • allows you to programmatically alter the request parameters sent to the service
    • should return updated $post array
  4. add_filter('Forms3rdPartyIntegration_service_filter_post', 'YOUR_HOOK', 10, 4);
    • in addition to service-specific with suffix _a#; accepts params $post, $service, $form, $sid
  5. add_filter('Forms3rdPartyIntegration_service_filter_args', 'YOUR_HOOK', 10, 3);
    • alter the args array sent to wp_remote_post
    • allows you to add headers or override the existing settings (timeout, body)
    • if you return an array containing the key response_bypass, it will skip the normal POST and instead use that value as the 3rdparty response; note that it must match the format of a regular wp_remote_post response.
    • Note: if using response_bypass you should consider including the original arguments in the callback result for debugging purposes.
  6. add_action('Forms3rdPartyIntegration_remote_failure', 'mycf7_fail', 10, 5);

    • hook to modify the Form (CF7 or GF) object if service failure of any kind occurs -- use like:

      function mycf7_fail(&$cf7, $debug, $service, $post, $response) { $cf7->skip_mail = true; // stop email from being sent // hijack message to notify user ///TODO: how to modify the "mail_sent" variable so the message isn't green? on_sent_ok hack? $cf7->messages['mail_sent_ok'] = 'Could not complete mail request:** ' . $response['safe_message']; }

    • needs some way to alter the mail_sent return variable in CF7 to better indicate an error - no way currently to access it directly.

  7. add_action('Forms3rdPartyIntegration_service_settings', 'YOUR_HOOK', 10, 3)
    • accepts params $eid, $P, $entity corresponding to the index of each service entity and this plugin's namespace, and the $entity settings array
    • allows you to add a section to each service admin settings
    • name form fields with plugin namespace to automatically save: $P[$eid][YOUR_CUSTOM_FIELD] $rarr; Forms3rdPartyIntegration[0][YOUR_CUSTOM_FIELD]
  8. add_action('Forms3rdPartyIntegration_service_metabox', 'YOUR_HOOK', 10, 2)
    • accepts params $P, $entity corresponding to the index of each service entity and this plugin's namespace, and the $options settings array (representing the full plugin settings)
    • allows you to append a metabox (or anything else) to the plugin admin settings page
    • name form fields with plugin namespace to automatically save: $P[YOUR_CUSTOM_FIELD] $rarr; Forms3rdPartyIntegration[YOUR_CUSTOM_FIELD]

Basic examples provided for service hooks directly on plugin Admin page (collapsed box "Examples of callback hooks"). Code samples for common CRMS included in the /3rd-parties plugin folder.

Stephen P. Kane Consulting

From the website and Handpicked Tomatoes:

Transparent and Holistic Approach

Transparency is good. It's amazing how many web design sites hide who they are. There are lots of reasons, none of which are good for the customer. We don't do that. I'm Stephen Kane, principal web craftsman at HandpickedTomatoes, and I'm an Orange County based freelancer who occasionally works with other local freelancers and agencies to deliver quality web solutions at very affordable prices. We work to earn the right to be a trusted partner. One that you can turn to for professional help in strategizing, developing, executing, and maintaining your Internet presence. We take a holistic view. Even if a project is small, our work should integrate into the big picture. We craft web architecture and designs that become winning websites that are easy to use and to share. We custom build social network footprints on sites like linkedin, facebook, twitter, youtube, flickr, yelp!, and google places and integrate them into your website to leverage social marketing. We help you set up and execute email campaigns, with search engine marketing, with photography, with site copy and content and anything else that you need in order to have a successful Internet presence. Through this holistic approach, we work with clients to grow their sales, improve their brand recognition, and manage their online reputation.

Requires: 3.0 or higher
Compatible up to: 3.8.3
Last Updated: 2014-7-18
Downloads: 5,163

Ratings

5 stars
5 out of 5 stars

Support

2 of 6 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1