Brevo Feed Meta

Introduction

The Feed Meta object for the Brevo Add-On is an associative array with properties determining how the add-on should process the form submission.

$feed['meta'] = array(
    'feedName'                             => 'Brevo Feed 1',
    'brevoList'                            => '',
    'feed_condition_conditional_logic_object' => array(),
    'feed_condition_conditional_logic'     => '0',
    'brevoFieldMap_email'                  => '1',
    'brevoFieldMap'                        => array(),
    'feedCondition'                        => '',
);

Usage

We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:

$conditional_logic_enabled = rgars( $feed, 'meta/feedCondition' );

if ( $conditional_logic_enabled ) {
    // Conditional logic is enabled for this feed.
    $logic_rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );
    foreach ( $logic_rules as $rule ) {
        // Process each conditional logic rule.
        $field_id  = rgar( $rule, 'fieldId' );
        $operator  = rgar( $rule, 'operator' );
        $value     = rgar( $rule, 'value' );
        // Example: Use $field_id, $operator, and $value in your logic.
    }
}

Properties

PropertyTypeDescription
feedNamestringA unique name for the Brevo feed.
brevoListstringThe Brevo List you would like to add your contacts to.
feed_condition_conditional_logic_objectarrayStores the conditional logic rules for the feed. Empty if no rules are defined.
feed_condition_conditional_logicbooleanDetermines whether conditional logic is enabled for the feed.
brevoFieldMap_emailstringThe ID of the form field to be mapped to the contact email address. Required.
brevoFieldMaparrayMaps form fields to Brevo contact attributes. Each item contains keycustom_keyvalue, and custom_value.
opt-inbooleanDetermines whether double opt-in is enabled for the feed.
templatestringThe ID of the Brevo email template to use for double opt-in. Required when opt-in is enabled.
redirect_urlstringThe URL the contact is redirected to after confirming their subscription. Supports merge tags. Required when opt-in is enabled.
feedConditionstringSpecifies additional conditions for running the feed.