Introduction
The Feed Meta Object for the EmailOctopus Add-On is an associative array with properties determining how the add-on should process the form submission.
$feed['meta'] = array(
'feedName' => 'EmailOctopus Feed 1',
'emailoctopuslist' => '2ca1s88a-d4d3-11ee-9cd3-5f9d9d5e7f30',
'feed_condition_conditional_logic' => '1',
'feed_condition_conditional_logic_object' => array(
'conditionalLogic' => array(
'actionType' => 'show',
'logicType' => 'all',
'rules' => array(
array(
'fieldId' => '1',
'operator' => 'isnot',
'value' => '',
),
),
),
),
'mappedFields_EmailAddress' => '1',
'mappedFields_FirstName' => '4.3',
'mappedFields_LastName' => '4.6',
'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
Property | Type | Description |
---|---|---|
feedName | string | A unique name for the feed. |
emailoctopuslist | string | The EmailOctopus list ID to which the data will be sent. |
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. |
mappedFields_EmailAddress | string | Specifies the field ID used to map the email address. |
mappedFields_FirstName | string | Specifies the field ID used to map the first name. |
mappedFields_LastName | 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. |