gform_zohocrm_contact

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:

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. (format: gform_zohocrm_contact_FORMID)

add_filter( 'gform_zohocrm_contact_4', 'your_function_name', 10, 4 );

Parameters

  • $contact array

    The contact arguments are an associative array.

array(
    '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 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;
    }
    

    Placement

    This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

    See also the PHP section in this article: Where Do I Put This Code?

    Source Code

    gf_apply_filters( 'gform_zohocrm_contact', $form['id'], $contact, $feed, $entry, $form );
    

    This filter is located in GFZohoCRM::create_contact() in class-gf-zohocrm.php.