gform_activecampaign_contact_pre_sync

Description

The gform_activecampaign_contact_pre_sync filter can be used to override the contact properties before the contact_sync request is sent to the API.

Usage

The filter which would run for all ActiveCampaign feeds can be used like so:

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

You can limit the scope of the filter to a single form by appending the form id on the end of the hook name like so:

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

Parameters

Examples

This example shows how you can add the ip4 property to the array.

add_filter( 'gform_activecampaign_contact_pre_sync', function( $contact, $entry, $form, $feed ) {

    $contact['ip4'] = rgar( $entry, 'ip' );

    return $contact;
}, 10, 4 );

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

$contact = apply_filters( 'gform_activecampaign_contact_pre_sync', $contact, $entry, $form, $feed );
$contact = apply_filters( 'gform_activecampaign_contact_pre_sync_' . $form['id'], $contact, $entry, $form, $feed );

This filter is located in GFActiveCampaign::process_feed() in class-gf-activecampaign.php.

Since

This filter was added in ActiveCampaign 1.3.5.