gform_brevo_allow_resubscription

Description

The gform_brevo_allow_resubscription filter allows you to modify whether a user with the unsubscribed status on your list can be resubscribed. By default, the user is resubscribed.

Usage

The following would apply to all forms.

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

To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_brevo_allow_resubscription_FORMID)

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

Parameters

ParameterTypeDescription
$allow_resubscriptionboolIf the user should be resubscribed.
$formarrayThe form object.
$entryarrayThe entry object.
$feedarrayThe feed object.

Examples

Prevent resubscription for unsubscribed users.

add_filter( 'gform_brevo_allow_resubscription', '__return_false' );

Allow resubscription only on form with ID 8.

add_filter( 'gform_brevo_allow_resubscription', '__return_false', 10 );
add_filter( 'gform_brevo_allow_resubscription_8', '__return_true', 15 );

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 Gravity Forms Brevo version 1.0.

Source Code

This filter is located in gravityformsbrevo/class-gf-brevo.php