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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | $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.:
1 2 3 4 5 6 7 8 9 10 11 12 13 | $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
Property | Type | Description |
---|---|---|
feedName | string | A unique name for the feed. |
feed_condition_conditional_logic | boolean | Enables conditional logic to determine if the feed should run. |
feed_condition_conditional_logic_object | array | Stores the conditional logic rules for the feed. |
mailerliteGroup | string | The MailerLite group ID to which the data will be sent. Leave empty if not used. |
mappedStandardFields_email | string | Specifies the field ID used to mapthe email address. |
mappedStandardFields_name | string | Specifies the field ID used to map the first name. |
mappedStandardFields_last_name | string | Specifies the field ID used to map the last name. |
optinCondition | string | Specifies the condition to determine if a user opts in. Leave empty for none. |