Description
This filter can be used to override the contact properties before they are passed to the GetResponse API.
Usage
The following would apply to all feeds:
add_filter( 'gform_getresponse_contact', 'your_function_name', 10, 5 );
To target feeds for a specific form append the form id to the filter name. (format: gform_getresponse_contact_FORMID)
add_filter( 'gform_getresponse_contact_1', 'your_function_name', 10, 5 );
Parameters
- $contact arrayThe contact properties.
- $existing_contact bool | array
False or the existing contact properties.
- $feed Feed Object
The feed currently being processed.
- $entry Entry Object
The entry currently being processed.
- $form Form Object
The form currently being processed.
Example
This example shows how you can modify the contact properties to trigger autoresponders when a contact is added to a list.
add_filter( 'gform_getresponse_contact', function ( $contact ) {
$contact['dayOfCycle'] = 0;
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?
Since
This filter was added in GetResponse version 1.4.
Source Code
This filter is located in gravityformsgetresponse/class-gf-getresponse.php.