Non unique count parameter name was causing that when more conditions
used all of operand the count parameter was overrode in the final combined query.
[MAILPOET-4010]
This creates a single method we can rely on to check for the uniqueness
of a segment name and refactors places where we had duplicate code to
use the new method.
[MAILPOET-3998]
This commit is part of a task to allow multiple values in "is in country" segment. This commit replaces the queries with the more performant ones written by @lysyjan. It also creates the lookup tables on the integration database and updates the test.
[MAILPOET-3952]
This commit is part of a task to allow multiple values in "is in country" segment. This commit first changes the string value $country to Array, adding a check for backwards compatibility and an integration test.
[MAILPOET-3952]
There was a bug that was making the code use the wrong filter
and thus the wrong SQL query for the "# number of machine opens"
segment. Resulting in the wrong subscribers being associated with this
segment.
The email() method of the FilterFactory was using the wrong check to
decide which filter to use for this segment (the filter should be
EmailOpensAbsoluteCountAction and the factory was using EmailAction).
This commit fixes this problem.
[MAILPOET-4011]
There was an issue in the old query used to get subscribers of the "has WooCommerce subscription" segment. When getting the IDs of the users
that purchased a given subscription, it would get all the entries from wp_woocommerce_order_items without checking the value of ordem_item_type.
The problem is that wp_woocommerce_order_items contains entries for the purchased product, but also other things like shipping and tax information. The WooCommerce Subscriptions extension uses wp_woocommerce_order_items to store data when a user switches from one subscription to another. This was causing users to be included in the "has WooCommerce subscription" segment even after they had switched from the subscription that belonged to the segment to another one.
This problem was fixed by adding another condition to the part of the query that joins with wp_woocommerce_order_items to get only entries that have the value 'line_item' for the field 'order_item_type'. This excludes entries where the value of 'order_item_type' is 'line_item_switched', which is what WC Subscriptions uses to track subscriptions that a user used to have before switching to something else.
[MAILPOET-3898]