Commit Graph

145 Commits

Author SHA1 Message Date
David Remer
b05e6d414c Remove WP\Functions::__ and other translate functions
Under the new sniffer rules, those functions produce errors and, when those methods
are used, the sniffer can not properly be applied.

[MAILPOET-4524]
2022-08-09 13:23:16 +02:00
Jan Lysý
2b5d089a79 Add tag filter into subscribers response
[MAILPOET-4442]
2022-08-08 10:57:42 +02:00
Rodrigo Primo
af396021db Move the query to calculate the max subscriber ID to SubscribersRepository
[MAILPOET-4344]
2022-08-04 11:10:50 +02:00
Sam Najian
5b0e7128c6 Remove usages of StatisticsNewsletters in newsletter exporter
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
31aa18868b Remove traces of older models in PersonalDataExports namespace
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
10d4eb5d7f Remove old models from SegmentsExporter
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Rodrigo Primo
7f055aef06 Replace Paris models with Doctrine in SubscriberPersonalDataEraser
[MAILPOET-4349]
2022-07-20 15:05:19 +02:00
Sam Najian
a2f65bf647 Migrate PersonalDataExporters\NewslettersExporter to Doctrine
[MAILPOET-4348]
2022-07-18 16:47:48 +02:00
Jan Lysý
856561c443 Remove old model usage from NewSubscriberNotificationMailer
[MAILPOET-4352]
2022-07-13 15:36:14 +02:00
Jan Lysý
6a0108edd0 Remove subscriberTag when tag doesn't exist
[MAILPOET-4440]
2022-07-12 13:35:00 +02:00
Jan Lysý
6baf4b21c3 Save or update subscriber's tags
[MAILPOET-4440]
2022-07-12 13:35:00 +02:00
Jan Lysý
79b27e005d Add SubscriberTagRepository
[MAILPOET-4440]
2022-07-12 13:35:00 +02:00
Jan Lysý
4440ebc3e6 Replace old model with Doctrine
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
John Oleksowicz
cf78783ef3 Include empty segments in subscribers filters
Although it doesn't make senses to select a segment with 0 subscribers
directly from the dropdown, we allow users to click a "view subscribers"
link or, with MAILPOET-4244, click a badge to see all the subscribers of
 that segment. The UI on the subscribers page indicates which segment is
  selected by selecting it in the dropdown.

 If we exclude lists with 0 subscribers (or 0 calculated
 subscribers), the filter selection is blank and the user has no way of
 knowing what filter is being applied. By including these empty lists
 we're giving users a way of knowing why there are 0 subscribers being
 shown.

MAILPOET-4244
2022-06-13 12:37:42 +02:00
Brezo Cordero
3d1365595b Remove catch block and change quotes
Remove catch block to log unexpected exceptions and change quotes for consistency on error message.

[MAILPOET-4259]
2022-06-06 11:59:27 +02:00
Brezo Cordero
2e5e8e808f Verify that new email is unique when editing a subscriber
Throws an exception with information message if email already exists.

[MAILPOET-4259]
2022-06-06 11:59:27 +02:00
Brezo Cordero
7c6f0b7777 Specify type of $fieldName to string on addField
[MAILPOET-3720]
2022-05-25 09:43:47 +02:00
Brezo Cordero
94fe87008a Remove PHPStan level 6 errors from Import
Remove the following errors from Subscribers\ImportExport\Import\MailChimp:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).

[MAILPOET-3720]
2022-05-25 09:43:47 +02:00
Brezo Cordero
34ce6cd329 Remove PHPStan level 6 errors from Import
Remove the following errors from Subscribers\ImportExport\Import\Import:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).

I have also added a few checks when using count and typed the arrays when possible.

[MAILPOET-3720]
2022-05-25 09:43:47 +02:00
Brezo Cordero
f6dfb19362 Remove PHPStan level 6 errors from Segments\WP
Remove the following errors:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).
array_walk on import.php was expecting the key as the second parameter to the function. I have switched it to array_map.

[MAILPOET-3720]
2022-05-23 12:04:12 +02:00
Rodrigo Primo
5c9926b140 Refactor ImportExportFactory to use Doctrine instead of Paris
[MAILPOET-4139]
2022-05-23 11:37:26 +02:00
Rodrigo Primo
ba47f0b854 Rename variables to make the ReCaptcha code easier to understand
This commit renames two variables to make it easier to understand the
code responsible for adding a ReCapcha to a subscription form:

formData.recaptcha -> formData.recaptchaWidgetId
formData.data.recaptcha -> formData.data.recaptchaResponseToken

Before this change it was harder to understand the difference between
formData.recaptcha and formData.data.recaptcha since they used the same
name.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
c1bd52b964 Add code to display the invisible ReCaptcha in the frontend
This commit adds the required code to display the invisible ReCaptcha in
the frontend when a form is rendered and this type of captcha is
selected in the admin.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Brezo Cordero
6e0b639fd3 Use intval instead of (int) to remove PHPStan errors
[MAILPOET-4281]
2022-05-09 13:05:21 +02:00
Brezo Cordero
bb3d1c2a7c Fix type error in meta in SubscribersEmailCount task
[MAILPOET-4281]
2022-05-09 13:05:21 +02:00
Rostislav Wolny
68cb5c4f79 Inject MailerFactory instead of mailer
We can't create mailer directly in DI container using the factory because it may fail in case
the plugin is not configured properly and prevent plugin from start.

The Mailer was previously injected because it contains lazy initialization.
The lazy initialization in the singleton Mailer service was dangerous,
because when used with some custom parameters it could cause that all services
that inject the Mailer from DI would use the custom config instead the default.
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Brezo Cordero
36baf4c4e3 Simplify the query to calculate lifetime emails
Get max and count of subscribers in the query.

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
7ab8055b69 Do not update email_count if there are no new emails
[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
8077322a29 Simplify the query to calculate lifetime emails
Also rename email_counts to email_count and update tests

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
9e8aaec6c9 Add lifetime email counts to inactive subscribers criteria
[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
8b7b234446 Create controller to count emails per subscriber
This controller is built to be called by a cron SimpleWorker.

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Rodrigo Primo
250e450c82 Replace most usages of old Subscriber model with SubscriberEntity in the Pages class
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rostislav Wolny
ac0a9e7b6f Update doctrine/* libraries
[MAILPOET-4175]
2022-03-28 13:49:41 +02:00
David Remer
45dd3fc308 Use current definition for counting subscribers in a Group
[MAILPOET-3535]
2022-03-24 16:00:56 +01:00
Brezo Cordero
5dc215efa7 Improve comments and tests for inactive subscribers
[MAILPOET-4081]
2022-03-14 12:07:59 +01:00
Brezo Cordero
6e6720d9f1 Remove old code and comments
[MAILPOET-4081]
2022-03-14 12:07:59 +01:00
Brezo Cordero
11cd756e6d Deactivation requires 3 received emails
[MAILPOET-4081]
2022-03-14 12:07:59 +01:00
Brezo Cordero
3fca53f350 Also count machine opens and clicks as engagement
[MAILPOET-4081]
2022-03-14 12:07:59 +01:00
Jan Jakes
86d934ba36 Add hook for segment subscription
This will be used for a "SegmentSubscribed" trigger for automation
that can trigger welcome emails and other actions.

[MAILPOET-4136]
2022-03-14 09:36:21 +01:00
Brezo Cordero
9f822818c3 Make sure batch size is positive integer
Fixes PHPStan error array_chunk expects int<1, max>.

[MAILPOET-4131]
2022-03-07 16:07:16 +01:00
Rostislav Wolny
f6a6dc1802 Rename premium page to upgrade page
[MAILPOET-4164]
2022-02-28 16:49:26 +01:00
Brezo Cordero
bfa9a98df6 Do not display form if logged in and registered to any segment.
[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
David Remer
b1f51714ca Add mailpoet_subscription_before_subscribe hook
In order for 3rd parties to hook into the subscription process, e.g. to
validate the data themselves, the action hook
mailpoet_subscription_before_subscribe has been added. [MAILPOET-3632]
2022-02-09 15:06:58 +01:00
Rostislav Wolny
94af2c324b Update subscriber last engagement with correct value
For mutable Carbon object $now->subMinute() was altering also $now variable which was causing that the saved engagement at was not accurate.
[MAILPOET-3897]
2022-02-07 09:38:25 +01:00
Jan Jakes
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00