Commit Graph

135 Commits

Author SHA1 Message Date
Jan Lysý
525c80bac4 Fix PHPStan warnings in lib
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00
David Remer
a1e59d5f31 Fix bug: Ensure data['tags'] is normalized
[MAILPOET-5515]
2023-10-09 10:06:56 +02:00
David Remer
f963332506 Fire mailpoet_subscriber_tag_removed after repository flush
[MAILPOET-5515]
2023-10-09 10:06:56 +02:00
David Remer
c93b433b93 Fire mailpoet_subscriber_tag_added hook after flush()
[MAILPOET-5515]
2023-10-09 10:06:56 +02:00
David Remer
47fea46dc4 Add tag added and removed actions
[MAILPOET-5515]
2023-10-09 10:06:56 +02:00
Jan Jakes
e2cf884b98 Add missing ContainerWrapper return type, fix reported errors
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
David Remer
84faac8257 Apply revenue_status in subscriber stats
[MAILPOET-5485]
2023-09-11 12:14:33 +02:00
David Remer
974559876b Add comments
[MAILPOET-5555]
2023-09-06 14:45:45 +02:00
David Remer
79999f53c3 Fix formatting
[MAILPOET-5555]
2023-09-06 14:45:45 +02:00
David Remer
ce4f19bd77 Do not resubscribe subscribers unnecessarily
[MAILPOET-5555]
2023-09-06 14:45:45 +02:00
David Remer
8170391731 Add primary key to inactive_task_ids and inactive_subscriber_ids table
[MAILPOET-4401]
2023-09-04 14:22:16 +02:00
John Oleksowicz
2987c61d77 Filter click stats by newsletter send time
MAILPOET-5508
2023-08-31 13:17:34 +02:00
John Oleksowicz
3b407d7060 Base open stats on emails sent in the same period
MAILPOET-5508
2023-08-31 13:17:34 +02:00
John Oleksowicz
06df45bb55 Refactor subscriber stats to accept startTime param
MAILPOET-5508
2023-08-31 13:17:34 +02:00
David Remer
76c299c3d7 Remove global count methods.
In the previous commit, we removed the global count for our output. This commit removes
the logic as the only places where it was used was in recalculating the cache and since
the last commit, we do not use this value anymore

[MAILPOET-4487]
2023-08-18 13:35:13 +02:00
David Remer
6dd0c844ca Take also list specific status into account when counting subscribers
[MAILPOET-4487]
2023-08-18 13:35:13 +02:00
David Remer
ec987b133d Categorize (un)subscribed users of a list correctly
To evaluate whether a user is subscribed to a list or unsubscribed you need to take into account
the status of the current subscription and not only the global status. To be unsubscribed you are
either globally or per list unsubscribed. To be subscribed you need to be globally and per list
subscribed

[MAILPOET-4487]
2023-08-18 13:35:13 +02:00
John Oleksowicz
327f78b902 Remove unused and unhelpful return value
MAILPOET-5410
2023-08-11 16:39:57 +02:00
John Oleksowicz
f0f24552f0 Update woo revenue stats to only look at past year
MAILPOET-5410
2023-08-11 16:39:57 +02:00
John Oleksowicz
62ac4d5e27 Make stats consistent with engagement score
This makes SubscriberStatisticsRepository the source of truth for
engagement score data instead of having separate queries.

As part of this change, we will now only be displaying the last year's
worth of data when viewing a report for an individual subscriber.

It also updates engagement score calculation to only count human opens,
not machine opens.

MAILPOET-5410
2023-08-11 16:39:57 +02:00
John Oleksowicz
3ec4505445 Add bulk update engagement score updated at method
MAILPOET-5410
2023-08-11 16:39:57 +02:00
Jan Lysý
577a82ca49 Add bulk action for removing tag from subscribers
[MAILPOET-5454]
2023-07-13 13:12:56 +02:00
Jan Lysý
aa12fd57d7 Add bulk action for tagging subscribers
[MAILPOET-5454]
2023-07-13 13:12:56 +02:00
John Oleksowicz
64a92c259d Add clarifying comment
MAILPOET-5404
2023-07-12 15:48:03 +02:00
John Oleksowicz
fc410c2154 Make sure lastProcessedSubscriberId is always correct
MAILPOET-5404
2023-07-12 15:48:03 +02:00
John Oleksowicz
25cbba1246 Use order by id for query
MAILPOET-5404
2023-07-12 15:48:03 +02:00
John Oleksowicz
73eae47a39 Add cron worker for backfilling engagement data
MAILPOET-5404
2023-07-12 15:48:03 +02:00
John Oleksowicz
8bf3eddf09 Return cached item for homepage stats
MAILPOET-5439
2023-07-10 11:04:33 +02:00
John Oleksowicz
b22217420f Track last sending at
MAILPOET-4998
2023-06-22 15:29:22 +02:00
John Oleksowicz
0e9b96d0b7 Track opens, clicks, purchases, and page views
MAILPOET-4998
2023-06-22 15:29:22 +02:00
Pavel Dohnal
798bc320ed Make sure the doctrine parameters are unique
Previously there was a mismatch between parameters coming from the
dynamic segment and the parameters coming from the export
controller.

[MAILPOET-5382]
2023-06-16 17:00:33 +02:00
Rodrigo Primo
0d3293be52 Remove Subscribers\Source::setSource()
I found this method in the context of a ticket to refactor Paris code to
Doctrine. As far as I can tell, it is not used anymore and it is
safe to delete it.

It was added in 1af5802 and was used only inside
Models\Subscriber::subscribe(). Then subscribe() was moved to
Subscriber\SubscriberActions in 7528f0f. Finally, commit 7db2384
refactored SubscriberActions removing the only two calls to
Source::setSource().

The test class SourceTest is removed as well as its only purpose was to
test Source::setSource().

[MAILPOET-5345]
2023-06-01 12:06:14 +02:00
alex-mailpoet
5203eb5268 Don't cache if subscribers count is below minimum value
[MAILPOET-5180]
2023-05-22 14:13:05 +02:00
alex-mailpoet
4cd1667146 Cache homepage subscribers stats
[MAILPOET-5180]
2023-05-22 14:13:05 +02:00
Rodrigo Primo
00d021109c Move ModelValidator::validateNonRoleEmail() to a new Validator class
We want to remove/refactor the whole ModelValidator class as part of the
Doctrine refactor.

This commit moves the method ModelValidator::validateNonRoleEmail() to a
new Validator class as the method is not used by the validator system of
the Paris models. ModelValidator::validateEmail() was also moved as it
is called by ModelValidator::validateNonRoleEmail().

[MAILPOET-4343]
2023-05-17 12:37:22 +02:00
Rodrigo Primo
d760272678 Remove ModelValidator::validateIPAddress()
We want to remove/refactor the whole ModelValidator class as part of the
Doctrine refactor. As a first step, this commit removes the method
ModelValidator::validateIPAddress(). It was unused in a single place and
it was replaced with a direct call to the builtin PHP way to validate an
IP address.

[MAILPOET-4343]
2023-05-17 12:37:22 +02:00
Jan Lysý
150042f670 Disable overriding custom fields on repeated subscribing
[MAILPOET-5246]
2023-05-03 11:31:24 +02:00
Jan Lysý
41abed3b15 Add custom field to subscriber's relation when it is created
[MAILPOET-5246]
2023-05-03 11:31:24 +02:00
Rodrigo Primo
5a85390655 Replace remaining calls to utf8_encode() with mb_convert_encoding()
In the previous commit, I removed all calls to the deprecated
utf8_encode() that seemed safe to remove. In this commit, I'm replacing
the calls to this function that I'm not sure if are same to remove or
not with mb_convert_encoding().

mb_convert_encoding() requires the extension mbstring to be enabled. It
should be enabled on most PHP install but not all. We are already using
mbstring functions in our code base and we provide a polyfill for PHP
installs where the extension is not enabled
(62bb75ed91/mailpoet/prefixer/composer.json (L25)).
So it should be safe to use it.

[MAILPOET-4865]
2023-04-28 10:26:03 +02:00
Brezo Cordero
2b83c8c69f Fix previously sanitized link
[MAILPOET-5254]
2023-04-21 11:14:25 +02:00
Jan Jakes
6f0307be95 Flush database changes before invoking "mailpoet_segment_subscribed" hook
This is to ensure the hook consumers can read up-to-date data from the database.

[MAILPOET-4946]
2023-04-20 16:32:32 +02:00
John Oleksowicz
6c03702fbd Fix test failure that was occurring for multisite
A previous test must have sent a confirmation email to a subscriber with
 the same ID.

 This didn't seem worth adding to the cleanup extension since it was
 only causing a single failure.

MAILPOET-5145
2023-04-07 20:17:05 -05:00
John Oleksowicz
f9d6e65ece Ensure personal data exporter includes all custom fields
The test testExportSubscriberWithCustomField was only passing before
because we were truncating tables in between tests, so the custom field
id ended up matching the subscriber custom field id coincidentally.

MAILPOET-5145
MAILPOET-5185
2023-04-07 12:11:12 -05:00
Sam Najian
ef3c64b85d Adjust use Html2Text from MailPoetVendor namespace
[MAILPOET-5128]
2023-03-15 15:02:32 -03:00
Jan Lysý
da3ec8c9a8 Fix getting max subscriber id
[MAILPOET-5084]
2023-02-27 09:37:43 +01:00
Rostislav Wolny
ee007e9392 Refactor fetching subscribers stats data
In the original approach we completely ignored subscribers who subscribed and unsubscribed
within the last 30 days.
Based on the feedback from QA this was quite confusing.
This commit changes the logic and instead of looking at current status we fetch the counts
based on logs (the lastSubscribedAt column and statistics_unsubscribes table) and we ignore the current status.
On the list level we don't have any logs so we still need to check the current status on the list level,
but newly we ignore the global status.
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00
Rostislav Wolny
9e157da66d Improve list level unsubscribe stats
We want to show admin how many subscribers subscribed to a list and how many
unsubscribed within last 30 days so that they see the change.
If someone subscribed and also unsubscribed within those 30 days we skip him.
We don't have data to detect they were really subscribed at some point.
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00
Rostislav Wolny
e3897fa04e Improve global unsubscribes stats on homepage
Before this fix if a subscriber subscribed multiple times
we counted them a multiple global unsubscribes
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00
Rostislav Wolny
04307ca2a6 Compute change of global subscribed subscribers
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00
Rostislav Wolny
076f79358e Add engagement score to the homepage subscribers stats
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00