Commit Graph

21402 Commits

Author SHA1 Message Date
Jan Jakes
c35fbdf70a Create transactional emails with order created/completed/cancelled triggers in the UI
[MAILPOET-5725]
2024-02-14 14:36:22 +01:00
Jan Jakes
a17fc5e963 Identify all triggers with "woocommerce:" key prefix as WooCommerce triggers
[MAILPOET-5725]
2024-02-14 14:36:22 +01:00
Jan Jakes
d5d20d5219 Send transactional emails with order created/completed/cancelled triggers
[MAILPOET-5725]
2024-02-14 14:36:22 +01:00
Jan Jakes
738c35891a Simplify getSinglePayloadByClass, remove wrong check
[MAILPOET-5720]
2024-02-14 14:36:22 +01:00
Jan Jakes
8b40553d0b Do not check subscriber against segment when sending transactional email
[MAILPOET-5720]
2024-02-14 14:36:22 +01:00
dependabot[bot]
d9d3dd41c7 Bump composer/composer from 2.2.22 to 2.2.23 in /mailpoet
Bumps [composer/composer](https://github.com/composer/composer) from 2.2.22 to 2.2.23.
- [Release notes](https://github.com/composer/composer/releases)
- [Changelog](https://github.com/composer/composer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/composer/composer/compare/2.2.22...2.2.23)

---
updated-dependencies:
- dependency-name: composer/composer
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-13 10:01:04 -06:00
Brezo Cordero
33fc16a04f Release 4.43.1 2024-02-13 08:40:51 -06:00
Jan Jakes
51a14a45d3 Use refreshAll() for updates, refresh subscribers/subscriber custom fields conditionally
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
alex-mpoet
014b8249bb Replace entityManager->clear with a helper, add cleanup to WP user sync
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
857ed69c61 Update integration test after change in \MailPoet\Segments\WP
In a previous commit, \MailPoet\Segments\WP was refactored to use
Doctrine instead of Paris. Paris would always convert subscriber emails
to lowercase. We don't do this with the Subscriber entity so it was
necessary to update this test after the refactor.

[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
f0434d74e7 Ensure Doctrine entity cache is cleared after changing the database
ImportExportRepository::updateMultiple() changes subscribers by running
MySQL queries directly. Now that \MailPoet\Segments\WP uses Doctrine as
well this was causing a bug caught by our integration tests.

```
MailPoet\Subscribers\ImportExport\Import\ImportTest::testItSynchronizesWpUsers
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'mary'
+'Mary'

/wp-core/wp-content/plugins/mailpoet/tests/integration/Subscribers/ImportExport/Import/ImportTest.php:719
```

https://app.circleci.com/pipelines/github/mailpoet/mailpoet/16386/workflows/c3fa0cf4-a77d-41ab-a5cc-78d4b37d9228/jobs/278066/tests#failed-test-0

This test was failing because the Doctrine entities were not updated
after the import process ran and modified the subscribers directly in
the database. Running EntityManager::clear() after importing the
subscribers, forces Doctrine to query the database again to update the
entities and prevents this bug.

[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
8318246e1e Improve the way WP users are deleted when running the tests
Doing this to be able to write tests that use any username or email as
it was done in the previous commit. Before the users needed to match the
pattern used inside WPTest::insertUser().

[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
6f98634b94 Replace Subscriber and SubscriberSegment models with Doctrine in \MailPoet\Segments\WP
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
01cafdf719 Replace Idiomr\ORM with Doctrine in WPTest
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
374fbe6867 Replace Segment model with Doctrine in \MailPoet\Segments\WP
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Rodrigo Primo
b63834b02b Change return type as the method always returns a segment
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
John Oleksowicz
0229eb76ef Only show tutorial icon on the editor
MAILPOET-5735
2024-02-12 13:16:11 +01:00
Jan Lysý
f8d99b34bf Check table exists before altering it
[MAILPOET-5896]
2024-02-12 11:50:48 +01:00
Jan Lysý
9f24247285 Add check if meta option is array
[MAILPOET-5891]
2024-02-12 11:15:36 +01:00
Jan Jakes
db2e61e987 Use "MAX(subscriber_id)" when fething "updated_at" to leverage DB indexes
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
60f1234b71 Check newsletter stats "sentAt" agains correct date (from subsriber task)
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
9db41a5210 Use scheduled task subsriber date for backfilling "sentAt" values
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
7814dda708 Backfill newsletter stats with processed subscribers even with failed status
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
0d71d96cfa Backfill missing sentAt from https://github.com/mailpoet/mailpoet/pull/5416
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
a5d44ba9b6 Backfill missing newsletter statistics from https://github.com/mailpoet/mailpoet/pull/5416
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
78732f8a5d Update also sending queue counts when marking stuck newsletters as sent
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
2804125827 Update also "sent_at" when marking stuck newsletters as sent
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
74f95b972f Split migration code into private methods
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
Jan Jakes
e3214e441b Add migration to fix sending tasks stuck in "invalid" state
[MAILPOET-5887]
2024-02-12 08:52:30 +02:00
John Oleksowicz
bbe471e653 Use standard formatting for env.sample
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
ecd7614337 Add defaults for unset env variables
These defaults maintain backwards compatibility if developers don't
change anything

MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
a78a31f110 Fix indentation
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
fcc4be330c Add set -e to hook scripts to exit on fail
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
52397951d8 Rename scripts and make messages consistent
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
97f811390d Make install js/php commands optional
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
7b64c47733 Don't run any git hooks unless env variable is set
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
bc4014d4a3 Make lint-staged commands configurable
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
ec6d26162b Add hooks to install updates automatically
MAILPOET-4237
2024-02-08 11:13:35 -06:00
John Oleksowicz
5d8d7adc08 Add command to install just PHP dependencies
MAILPOET-4237
2024-02-08 11:13:35 -06:00
dependabot[bot]
15b351b3f1 Bump follow-redirects from 1.15.2 to 1.15.4
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 12:15:20 +01:00
Jan Lysý
d4d4db7cc5 Release 4.43.0 2024-02-06 14:47:57 +01:00
Rostislav Wolny
c2c9429706 Fix TransactionalEmailHooksTest failing on MySQL 8
[MAILPOET-5886]
2024-02-05 15:24:26 +01:00
Rostislav Wolny
de9c03a3bc Add migration for fixing status for newsletters stuck as sending
[MAILPOET-5886]
2024-02-05 15:24:26 +01:00
Rostislav Wolny
7b86de1346 Set sentAt date when saving newsletter stats
MySQL 8 can't handle null values for not null columns even when we set a default
See detailed explanation
https://kedar.nitty-witty.com/blog/mysql-8-timestamp-cannot-be-null-and-explicit_defaults_for_timestamp
[MAILPOET-5886]
2024-02-05 15:24:26 +01:00
Rostislav Wolny
749c4e5e43 Prevent deleting and further changes in detached tasks during sending
When a post notification history is deleted in
MailPoet\Cron\Workers\SendingQueue\Tasks\Newsletter::preProcessNewsletter
it is also detached from EntityManager.

Any further attempt to manipulate the entity via EntityManager (remove or flush) causes
errors like "ERROR: A new entity was found through the relationship 'MailPoet\Entities\ScheduledTaskEntity#sendingQueue'"

In this commit we prevent doing such changes.
[MAILPOET-5880]
2024-02-05 15:16:11 +01:00
Rostislav Wolny
6a86dfc7c0 Throw an exception when preprocessing a newsletter without a queue
The goal of this commit is to change the preProcessNewsletter method
to return false only in case when it deleted the newsletter and
all associated entities. So that we know for sure that false means all was deleted.
[MAILPOET-5880]
2024-02-05 15:16:11 +01:00
Jan Jakes
ac6cc881d1 Fix error when permanently deleting a legacy automation
[MAILPOET-5833]
2024-02-05 13:28:15 +01:00
Jan Jakes
7bfcf4bd67 Move redirect to useEffect
[MAILPOET-5833]
2024-02-05 13:28:15 +01:00
Jan Jakes
f24184fe16 Add automation name also to URL-based notices
[MAILPOET-5833]
2024-02-05 13:28:15 +01:00
Jan Jakes
6994afebb7 Remove unused URL-based notices
[MAILPOET-5833]
2024-02-05 13:28:15 +01:00