MailerLite Feed Meta

Introduction

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

$feed['meta'] = array(
    'feedName' => 'MailerLite Feed 1',
    'mappedFields' => array(
        0 => array(
            'key' => 'all',
            'custom_key' => '',
            'value' => 'id',
            'custom_value' => '',
        ),
    ),
    'feed_condition_conditional_logic_object' => array(
        'conditionalLogic' => array(
            'actionType' => 'show',
            'logicType'  => 'all',
            'rules'      => array(
                0 => array(
                    'fieldId'  => '1',
                    'operator' => 'isnot',
                    'value'    => '',
                ),
            ),
        ),
    ),
    'feed_condition_conditional_logic' => '1',
    'mailerliteGroup' => '',
    'mappedStandardFields_email' => '',
    'mappedStandardFields_name' => '',
    'mappedStandardFields_last_name' => '',
    'optinCondition' => '',
);

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 feed.
feed_condition_conditional_logicbooleanEnables conditional logic to determine if the feed should run.
feed_condition_conditional_logic_objectarrayStores the conditional logic rules for the feed.
mailerliteGroupstringThe MailerLite group ID to which the data will be sent. Leave empty if not used.
mappedStandardFields_emailstringSpecifies the field ID used to mapthe email address.
mappedStandardFields_namestringSpecifies the field ID used to map the first name.
mappedStandardFields_last_namestringSpecifies the field ID used to map the last name.
optinConditionstringSpecifies the condition to determine if a user opts in. Leave empty for none.