Introduction
The Feed Meta Object for the Constant Contact Add-On is an associative array with properties determining how the add-on should process the form submission.
$feed['meta'] = array(
'feedName' => 'Constant Contact Feed 1',
'list' => '2970d510-d1c8-11ee-9061-fa163e638ddc',
'custom_fields' => array(
0 => array(
'key' => 'b76247be-4aa4-11ef-a233-fa163eeaf818',
'custom_key' => '',
'value' => '4',
'custom_value' => '',
),
),
'feed_condition_conditional_logic_object' => array(),
'feed_condition_conditional_logic' => '0',
'fields_email_address' => '1',
'fields_first_name' => '3',
'fields_last_name' => '4',
'fields_job_title' => '',
'fields_company_name' => '',
'fields_home_number' => '',
'fields_mobile_number' => '',
'fields_work_number' => '',
'fields_address_line_1' => '',
'fields_city_name' => '',
'fields_state_name' => '',
'fields_zip_code' => '',
'fields_country_name' => '',
'feed_condition' => '',
'trial_product' => NULL,
'trial_amount' => NULL,
);
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 Constant Contact feed. |
list | string | The ID of the list in Constant Contact to which contacts are added. |
custom_fields | array | An array of custom fields used to map additional data to Constant Contact fields. |
feed_condition_conditional_logic_object | array | Stores the conditional logic rules for the feed. |
feed_condition_conditional_logic | boolean | Determines whether conditional logic is enabled for the feed. |
fields_email_address | integer | Specifies the field ID used to map the email address. |
fields_first_name | integer | Specifies the field ID used to map the first name. |
fields_last_name | integer | Specifies the field ID used to map the last name. |
fields_job_title | string | Specifies the field ID used to map the job title. |
fields_company_name | string | Specifies the field ID used to map the company name. |
fields_home_number | string | Specifies the field ID used to map the home phone number. |
fields_mobile_number | string | Specifies the field ID used to map the mobile phone number. |
fields_work_number | string | Specifies the field ID used to map the work phone number. |
fields_address_line_1 | string | Specifies the field ID used to map the first address line. |
fields_city_name | string | Specifies the field ID used to map the city name. |
fields_state_name | string | Specifies the field ID used to map the state name. |
fields_zip_code | string | Specify the field ID used to map the zip code. |
fields_country_name | string | Specifies the field ID used to map the country name. |
feed_condition | string | Specifies additional conditions for running the feed. |
trial_product | null | Specifies the trial product. NULL if not applicable. |
trial_amount | null | Defines the trial amount. NULL if not applicable. |
Custom Field Properties
array(
'key' => '',
'custom_key' => '',
'value' => '',
'custom_value' => '',
);
Setting | Type | Description |
---|---|---|
key | string | The name of the custom field. |
custom_key | string | Custom key if any. |
value | string | The ID of the form field or entry meta item contains this custom field’s value. Merge tags supported. |
custom_value | string | Custom value for the field. |