DescriptionUsageParametersExamplesChange Email Opt OutPlacementSource Code
Description
This filter can be used to modify the contact arguments before they are sent to Zoho CRM.
Usage
The following would apply to all feeds:
1add_filter( 'gform_zohocrm_contact', 'your_function_name', 10, 4 );
To target feeds for a specific form append the form id to the hook name. (format: gform_zohocrm_contact_FORMID)
1add_filter( 'gform_zohocrm_contact_4', 'your_function_name', 10, 4 );
Parameters
$contact array
The contact arguments are an associative array.
1234567891011array( 'Email Opt Out' => 'false', 'Description' => 'some text', 'Lead Source' => 'Advertisement', 'SMOWNERID' => 'The-Zoho-CRM-User-ID-Here', 'options' => array( 'duplicateCheck' => '1', 'isApproval' => 'false', 'wfTrigger' => 'false' ),)
$feed Feed Object
The feed currently being processed.
$entry Entry Object
The entry currently being processed.
$form Form Object
The form currently being processed.
Examples
Change Email Opt Out
This example shows how you can change the 『Email Opt Out』 setting based on a field value in the Entry Object.
12345678add_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;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
1gf_apply_filters( 'gform_zohocrm_contact', $form['id'], $contact, $feed, $entry, $form )
This filter is located in GFZohoCRM::create_contact() in class-gf-zohocrm.php.