The gform_getresponse_contact Gravity Forms PHP filter allows you to modify contact properties before they are sent to the GetResponse API.
Usage
To apply the filter 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 (array): The 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.
More information
See Gravity Forms Docs: gform_getresponse_contact
Examples
Trigger Autoresponders When a Contact is Added to a List
This example demonstrates how to 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; });
Note: Place this code in the functions.php file of the active theme, a custom functions plugin, or a custom add-on. See Where Do I Put This Code? for more information.
This filter was added in GetResponse version 1.4 and is located in gravityformsgetresponse/class-gf-getresponse.php.