Commit Graph

349 Commits

Author SHA1 Message Date
Jan Lysý
c83f99ab1a Fix code style of the new code
[MAILPOET-3912]
2022-01-13 09:23:55 +01:00
Jan Lysý
09c2ce653c Fix code style by updated ruleset
[MAILPOET-3912]
2022-01-13 09:23:55 +01:00
Rodrigo Primo
8ac0c9c70f Add two new comparison options to the subscribed date segment
This commit adds two new comparison options ("on" and "not on")
to the "subscribed date" segment.

[MAILPOET-3614]
2022-01-13 09:22:42 +01:00
Rodrigo Primo
d7e615f022 Add more comparison options for two segments
This commit adds two new comparison options ("equals" and "not equals")
to the segments "# of opens" and "# of machine-opens".

[MAILPOET-3614]
2022-01-13 09:22:42 +01:00
Pavel Dohnal
91c34e43b3 Fix clicked segments
[MAILPOET-4045]
2022-01-11 12:47:25 +01:00
Jan Lysý
a5a0516323 Prevent infinite loop during WC sync
[MAILPOET-4052]
2022-01-11 09:31:51 +01:00
Jan Lysý
fb583b6162 Use WooCommerce tables instead of postmeta
[MAILPOET-3576]
2022-01-10 09:49:07 +01:00
wxa
5641efb0d7 Move multi-conditional segment processing to Premium
[MAILPOET-3929]
2021-12-23 09:53:03 +01:00
wxa
5e486462c0 Require Premium plugin for multi-condition segments
[MAILPOET-3929]
2021-12-23 09:53:03 +01:00
Rostislav Wolny
e971958297 Add migration for updating Woo Subscription segment data
[MAILPOET-3956]
2021-12-23 08:50:27 +01:00
Rostislav Wolny
8f78ad9939 Add all of and none of operators for Woo Subscription segment
[MAILPOET-3956]
2021-12-23 08:50:27 +01:00
Rostislav Wolny
651528c0b6 Add support for multiple any of for Woo subscriptions segment
[MAILPOET-3956]
2021-12-23 08:50:27 +01:00
wxa
e53d746432 Add more comparisons for WooCommerce dynamic segments
[MAILPOET-4007]
2021-12-23 08:48:36 +01:00
Rostislav Wolny
6b92810281 Fix multiple purchased product conditions with all of
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]
2021-12-23 08:45:54 +01:00
John Oleksowicz
df119d18a0 Refactor duplicate segment name checks
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]
2021-12-22 09:36:56 +01:00
John Oleksowicz
c23d8cae53 Add unique name check to segments repository
[MAILPOET-3998]
2021-12-22 09:36:56 +01:00
Pavel Dohnal
21fcc69b36 Use a better comparasion
[MAILPOET-4008]
2021-12-20 12:40:25 +01:00
Pavel Dohnal
65ef9b6572 More comparison options for custom field segment
[MAILPOET-4008]
2021-12-20 12:40:25 +01:00
Pavel Dohnal
e114bfcafb Fix none of query
[MAILPOET-3950]
2021-12-20 09:48:56 +01:00
Pavel Dohnal
9c0b27644a Map newsletters array
[MAILPOET-3950]
2021-12-20 09:48:56 +01:00
Pavel Dohnal
c13727a02b Process multiple newsletters with operator NONE
[MAILPOET-3950]
2021-12-20 09:48:56 +01:00
Pavel Dohnal
57560bddaf Process multiple newsletters with operator ALL
[MAILPOET-3950]
2021-12-20 09:48:56 +01:00
Pavel Dohnal
b47842c461 Process multiple newsletters with operator ANY
[MAILPOET-3950]
2021-12-20 09:48:56 +01:00
Pavel Dohnal
0b4614be1e Move clicked any link to a new class
[MAILPOET-3950]
2021-12-20 09:48:56 +01:00
Brezo Cordero
9a9ab257c2 Map operator for "is in country" dynamic filter
[MAILPOET-3952]
2021-12-20 09:29:41 +01:00
Brezo Cordero
67036f5d74 Add Any and None conditions to "is in country" segment
[MAILPOET-3952]
2021-12-20 09:29:41 +01:00
Brezo Cordero
06a4be4214 Use WC lookup tables for improved performance
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]
2021-12-20 09:29:41 +01:00
Brezo Cordero
b04cb41921 Make country always array
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]
2021-12-20 09:29:41 +01:00
Oluwaseun Olorunsola
02fc0df655 Fixed count missing parameter suffix
[MAILPOET-3953]
2021-12-20 09:26:13 +01:00
Oluwaseun Olorunsola
ea23ee63ae Allow multiple values in purchased in this category segment
[MAILPOET-3953]
2021-12-20 09:26:13 +01:00
Pavel Dohnal
c1f4e0bf32 Make sure the user roles is always array
[MAILPOET-3955]
2021-12-16 14:46:16 +01:00
Pavel Dohnal
78e1ea5954 Map operator in WP role
[MAILPOET-3955]
2021-12-16 14:46:16 +01:00
Pavel Dohnal
c5d994dbf0 Make the segment work with ALL condition
[MAILPOET-3955]
2021-12-16 14:46:16 +01:00
Pavel Dohnal
d541edc865 Make the segment work with NONE condition
[MAILPOET-3955]
2021-12-16 14:46:16 +01:00
Pavel Dohnal
6d5d5ccfda Make the segment work with ANY condition
[MAILPOET-3955]
2021-12-16 14:46:16 +01:00
Pavel Dohnal
c2e841fd3d Make role always array
[MAILPOET-3955]
2021-12-16 14:46:16 +01:00
Rodrigo Primo
d39d09dd72 Remove calls to Subscriber::setError() from ConfirmationEmailMailer
This commit is part of a task to replace Paris with Doctrine in the
class ConfirmationEmailMailer. Specifically, it removes two calls to
Subscriber::setError() inside ConfirmationEmailMailer::sendConfirmationEmail().

setError() was used to define an error message that was used only in one
of the instances where sendConfirmationEmail() is called
(API::subscribeToLists()). setError() was replaced with code that throws
an exception when there is an error. Thus it was necessary to change all
the places where ConfirmationEmailMailer::sendConfirmationEmail() is
called to handle the exception.

In some cases, there are some oddities as sendConfirmationEmail() can
return false or throw an exception in case of an error and calling code
must account for both. I decided to settle with this approach as
refactoring the rest of this method to use exceptions instead of
returning false seemed outside of the scope of this task.

[MAILPOET-3815]
2021-12-13 16:03:07 +01:00
Rodrigo Primo
6c05b3eaf0 Pass SubscriberEntity to sendConfirmationEmail() and sendConfirmationEmailOnce()
This commit changes the methods sendConfirmationEmail() and
sendConfirmationEmailOnce() to accept as the first parameter an instance
of SubscriberEntity instead of the old model Subscriber. It also updates
all the places where those two methods are called.

[MAILPOET-3815]
2021-12-13 16:03:07 +01:00
Rodrigo Primo
1c195789ba Fix "# number of machine opens" segment
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]
2021-12-13 13:54:17 +01:00
Rostislav Wolny
2b4f8de61a Fix segment selections
PHP8.1 fixed a PDO bug (https://bugs.php.net/bug.php?id=80808) that was causing
that integer columns were fetched as strings.
[MAILPOET-3980]
2021-12-13 09:36:43 +01:00
Jan Lysý
a3cd53e9c2 Use lower batchSize and move constant
[MAILPOET-3954]
2021-12-06 14:52:34 +01:00
Jan Lysý
14731a46fa Refactor inserting from orders
[MAILPOET-3954]
2021-12-06 14:52:34 +01:00
Jan Lysý
565abbf897 Ensure collation is set
[MAILPOET-3954]
2021-12-06 14:52:34 +01:00
Jan Lysý
9bd6cb159c Sync subscribers sequentially from orders
[MAILPOET-3954]
2021-12-06 14:52:34 +01:00
Jan Lysý
c0c7e23b0e Remove the rest of the old model usage
[MAILPOET-3753]
2021-12-06 14:52:34 +01:00
Jan Lysý
2ada3c8b75 Change behavior to update names in batch
[MAILPOET-3753]
2021-12-06 14:52:34 +01:00
Jan Lysý
d3ee546518 Add support for more product ids in filter
[MAILPOET-3954]
2021-12-01 09:13:20 +01:00
Pavel Dohnal
e2aef203d2 Make sure segment id is always number
[MAILPOET-3502]
2021-11-30 12:33:38 +01:00
Pavel Dohnal
f759057fa8 Add filter
[MAILPOET-3502]
2021-11-30 12:33:38 +01:00
Pavel Dohnal
ec390b2131 Add list segment to data mapper
[MAILPOET-3502]
2021-11-30 12:33:38 +01:00