The gform_zohocrm_contact filter allows you to modify the contact arguments before they are sent to Zoho CRM.
Usage
For all feeds, use the following code:
add_filter('gform_zohocrm_contact', 'your_function_name', 10, 4);
To target feeds for a specific form, append the form ID to the hook name:
add_filter('gform_zohocrm_contact_4', 'your_function_name', 10, 4);
Parameters
- $contact (array) – The contact arguments in an associative array.
- $feed (Feed Object) – The feed currently being processed.
- $entry (Entry Object) – The entry currently being processed.
- $form (Form Object) – The form currently being processed.
More information
See Gravity Forms Docs: gform_zohocrm_contact
Source Code: This filter is located in GFZohoCRM::create_contact() in class-gf-zohocrm.php
.
Examples
Change Email Opt Out
This example demonstrates how to change the ‘Email Opt Out’ setting based on a field value in the Entry Object.
add_filter('gform_zohocrm_contact_4', 'change_contact_argument', 10, 4); function change_contact_argument($contact, $feed, $entry, $form) { if (rgars($feed, 'meta/feedName') == 'Zoho CRM Feed 2' && rgar($entry, '5') == 'No') { $contact['Email Opt Out'] = 'true'; } return $contact; }