Commit Graph

39 Commits

Author SHA1 Message Date
Rodrigo Primo
42b5efda1b Remove Tasks\Sending
This class is not used anymore and can be removed.

[MAILPOET-5684]
2024-01-31 12:21:54 +01:00
David Remer
37d3e61bd2 Ignore ORMInvalidArgumentException when trying to remove the SendingQueueEntity
When a newsletter gets deleted in the Newsletter Repository the associated SendingQueueEntity gets removed.
This can happen and afterwards the SendingTask gets deleted. In these cases, we catch the error that
the entity can not be removed and continue the process.

[MAILPOET-5829]
2024-01-20 14:02:52 +05:00
Rodrigo Primo
876a9489a4 Replace \MailPoet\Tasks\Sending with Doctrine in SendingQueueTest
This commit also removes Sending::getSendingQueueEntity() as the last
calls to this method were removed when refactoring SendingQueueTest.

[MAILPOET-5682]
2024-01-12 13:25:46 +01:00
Jan Jakes
e3ff7ccaca Remove remaining usages of MailPoet\Task\Sending from SendingQueue::processSending()
[MAILPOET-5682]
2024-01-12 13:25:46 +01:00
Jan Jakes
fa266dadcd Rewrite SendingErrorHandler using Doctrine
[MAILPOET-5682]
2024-01-12 13:25:46 +01:00
Jan Lysý
525c80bac4 Fix PHPStan warnings in lib
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00
Jan Jakes
68abd6b964 Remove MailPoet\Tasks\Sending::BATCH_SIZE
[MAILPOET-4375]
2023-11-02 12:53:36 +01:00
Rodrigo Primo
46f317563e Don't thrown an exception if data is incorrect
See https://github.com/mailpoet/mailpoet/pull/5238#discussion_r1371462690

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
040ed6fa80 Minor improvement: use ScheduledTaskEntity::getSendingQueue()
Using it to avoid using $this->queue->id

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
18d34202a8 Remove remaining uses of the ScheduledTaskSubscriber model from Sending
[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
63a0f0b940 Remove \MailPoet\Tasks\Subscribers class now that it is not used anymore
[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
8b4e747499 Refactor Sending::saveSubscriberError() to use Doctrine instead of Paris
[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
d5cb060cb5 Refactor Sending::delete() to use Doctrine instead of Paris
[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
2b368141db Refactor updateProcessedSubscribers() to use Doctrine instead of Paris
It was necessary to update a test to be more lenient when comparing
dates and another one to persist a change in Paris to the database.

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
c0a091de04 Add the ScheduledTaskEntity as a property to the Sending class
Doing this instead of having to get the ScheduledTaskEntity in several
methods of this class.

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
4e633f64fb Remove unused method removeAllSubscribers()
This method was added in c0c57f6b67 but
its only usage besides integration test was removed in
18a6a1c439. It doesn't seem like it is
still used in our code base.

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
fefaf174cd Refactor Sending::removeSubscribers() to use Doctrine instead of Paris
[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
8fd8b8f193 Refactor Sending::setSubscribers() to use Doctrine instead of Paris
[MAILPOET-4368]
2023-10-25 10:31:45 +02:00
Rodrigo Primo
b252043dac Refactor Sending::getSubscribers() to use Doctrine instead of Paris
[MAILPOET-4368]
2023-10-25 10:31:45 +02:00
Jan Jakes
e2cf884b98 Add missing ContainerWrapper return type, fix reported errors
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
alex-mailpoet
5d88f02216 Replace multiple subscriber update queries with one in sending loop
[MAILPOET-5178]
2023-07-03 16:52:46 +02:00
alex-mailpoet
764114edc7 Replace two counting DB queries with arithmetic in sending loop
[MAILPOET-5178]
2023-07-03 16:52:46 +02:00
Jan Lysý
2ead4214cd Move query with inserting task subscribers to repository
[MAILPOET-4303]
2023-03-22 09:20:11 +01:00
Jan Jakes
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Rostislav Wolny
918a4d7c74 Refresh the sending queue entity when fetching it from the old model
By moving the refresh code into the method used for getting sending queue entity for the old model object
we want to make our code better protected from working with inconsistent sending queue data.
[MAILPOET-4750]
2022-10-27 12:08:31 +02:00
Rostislav Wolny
ec29c8fb49 Change order of saving sending task related data
In case we save the task and and queue saving fails the sending may be triggered with incorrect data in the queue.
Since the scheduled task is used for controlling sending state lets save it as last so that we are sure all related
data are up to date before saving the task.
[MAILPOET-4750]
2022-10-27 12:08:31 +02:00
Rodrigo Primo
ccbdbd3e93 Refactor getNewsletterFromQueue() to use Doctrine instead of Paris
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Jan Lysý
cb4fabad4a Remove the Sending::getScheduledQueues() method
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Sam Najian
873c295e99 Remove Paris models and Tasks\Sending from PostNotificationScheduler
[MAILPOET-4371]
2022-08-22 13:06:43 +02:00
Sam Najian
c22d23f91c Remove Tasks\State class and relevant test file
[MAILPOET-4355]
2022-08-22 11:24:06 +02:00
Jan Lysý
a362b7e014 Delete Sending::getRunningQueues()
[MAILPOET-4366]
2022-08-19 15:11:23 +02:00
Rodrigo Primo
d8770675a4 Replace Paris models with Doctrine entities in BatchIterator
[MAILPOET-4357]
2022-08-16 15:03:52 +02:00
Rodrigo Primo
6532cc1bec Fix bug when displaying email subjects in the system status page
The commit f44afbddf2 introduced a bug
when replacing Paris code with Doctrine code in lib/Tasks/State.php.
This bug was causing the system status page to display "Preview" instead
of the subject of the listed emails. The problem was happening because
during the refactor there was a mistake and we were trying to get a
SendingQueueEntity via its ID using the ScheduledTaskEntity ID. This
commit fixes this problem by getting a SendingQueueEntity that matches
the given ScheduledTaskEntity ID.

[MAILPOET-4508]
2022-08-09 13:19:47 +02:00
Sam Najian
f44afbddf2 Remove SendingQueue model usages
[MAILPOET-4361]
2022-07-18 16:47:48 +02:00
Jan Lysý
1310e5afec Disable marking subscribers as processed on error
[MAILPOET-4200]
2022-04-25 10:58:12 +02:00
Rostislav Wolny
9b71a7804c Update Monolog/Monolog from v1 to v2
[MAILPOET-4175]
2022-03-28 13:49:41 +02:00
Jan Lysý
391e19f692 Improve compatibility BatchIterator with PHP 8.1
[MAILPOET-4053]
2022-01-19 13:14:42 +01:00
Jan Lysý
5373c811b2 Add return annotation in BatchIterator
PHPStan reported an error in PHP8.1. When we use
the annotation ReturnTypeWillChange it caused another error
for PHPStan in combination in PHP7.2. The new annotations
are solving those issues.
[MAILPOET-4053]
2022-01-19 13:14:42 +01:00
Jan Jakes
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00