Commit Graph

23 Commits

Author SHA1 Message Date
2c159b1694 Document the types of two SendingQueue properties that were undocumented
It was also necessary to add an if condition to check the type of a
variable before calling one of the methods of one of the documented
properties.

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
f578f3f16a Remove method Tasks\Newsletter\getNewsletterSegments()
This method was used only once inside SendingQueue and it can be
replaced by NewsletterEntity::getSegmentIds() to simplify the code.

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
ccbdbd3e93 Refactor getNewsletterFromQueue() to use Doctrine instead of Paris
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
9a92068d5b Refactor Newsletter to use Doctrine instead of the Newsletter model
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
68c3277195 Replace Subscriber model with Doctrine in Tasks\Newsletter
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
fd0acbd6cf Refactor Newsletter to use Doctrine instead of the NewsletterSegment model
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
05664a0c6a Refactor markNewsletterAsSent() to use Doctrine instead of Paris
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
f9261dbeb4 Use constants from ScheduledTaskEntity
[MAILPOET-4309]
2022-08-31 13:42:21 +02:00
fecb26b3b5 Replace usage ScheduledTask::touchAllByIds with repository
[MAILPOET-4309]
2022-08-31 13:42:21 +02:00
5dfda9f3e2 Move task type const from entity to worker
[MAILPOET-4366]
2022-08-19 15:11:23 +02:00
bf74a506b7 Replace using Sending::getRunningQueues
[MAILPOET-4366]
2022-08-19 15:11:23 +02:00
8d4799b050 Fix models check conditions in sending queue
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
5042cdd15e Refactor fetching newsletter options in SendingQueue using doctrine
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
ae13fcc771 Make sure $metas[] is always set for all subscribers in the foreach loop
See https://github.com/mailpoet/mailpoet/pull/4247#pullrequestreview-1050167548

[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
932512b720 Replace Paris models with Doctrine entities in MetaInfoTest
In the process it was necessary to change the signature of the method
\MailPoet\Mailer\MetaInfo::getNewsletterMetaInfo() to accept a
SubscriberEntity instead of a Subscriber model and also change
\MailPoet\Cron\Workers\SendingQueue\SendingQueue::processQueue() as it
calls getNewsletterMetaInfo().

Doing this was straightforward, but changing the test class for
SendingQueue was a bit more involved. In particular, the test
SendingQueueTest::testItEnforcesExecutionLimitsAfterQueueProcessing().

This test is a bit brittle and was creating Subscriber models without
saving them to the database with invalid statuses and sources. Switching
getNewsletterMetaInfo() to use entities, while
SendingQueue::processQueue() still uses models, meant that it was
necessary to save the subscribers to the database. Because of this, it
was not possible anymore to use invalid statuses and sources, and
thus, the test changed a bit.

[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
1310e5afec Disable marking subscribers as processed on error
[MAILPOET-4200]
2022-04-25 10:58:12 +02:00
d4a8315933 Use mailerFactory in SendingQueue Mailer task
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
9b71a7804c Update Monolog/Monolog from v1 to v2
[MAILPOET-4175]
2022-03-28 13:49:41 +02:00
82e05dfe0f Add fixes for better compatibility with PHP8.1
[MAILPOET-4015]
2022-03-14 09:38:20 +01:00
6a6c04f168 Fetch only subscribed recipients when sending a newsletter
[MAILPOET-4166]
2022-03-07 16:05:48 +01:00
db6e963c94 Reset $metas array in processing method 'individual' [MAILPOET-3943] 2022-02-09 15:07:21 +01:00
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
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00