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
David Remer
522629eeff
Update other instances where SendingTask and Entity get out of sync
...
[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
David Remer
2298b5b061
Be more restrictive when deleting a queue task
...
getNewsletterFromQueue() has too many conditions under which it returns null. Therefore we can not rely on that method when we wont to delete running tasks with no associated newsletter.
[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
David Remer
94da004454
Refresh newsletterEntity and taskEntity.
...
We need to refresh those, because the database values have
changed and Doctrine needs to clear its internal cache.
[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
David Remer
307989a0c6
Delete task when no newsletter was found
...
When no corresponding newsletter was found the task can be deleted. The behavior
before meant that such a task would remain forever in the database with the
status 'running'.
[MAILPOET-4699]
2022-10-06 12:06:13 +02:00
Rodrigo Primo
54ea394f82
Deprecate filter as part of a Doctrine refactor
...
This commit deprecates the filter
mailpoet_sending_newsletter_render_after and replaces it with
mailpoet_sending_newsletter_render_after_pre_process. This was necessary
because as part of a Doctrine refactor one of the parameters passed to
the old filter changed from a Newsletter model to a Newsletter entity.
[MAILPOET-4680]
2022-10-04 14:41:00 +02:00
Rodrigo Primo
d39440f1dc
Refactor Newsletter::preProcessNewsletter() to use Doctrine
...
This commit also removes almost all the usages of the old Newsletter
model from NewsletterTest.
[MAILPOET-4680]
2022-10-04 14:41:00 +02:00
Rodrigo Primo
095cddc67e
Change Posts::getAlcPostsCount() to use Doctine instead of Paris
...
[MAILPOET-4680]
2022-10-04 14:41:00 +02:00
Rodrigo Primo
83319949ef
Use WooCommerce code instead of direct query to get highest order ID
...
[MAILPOET-4570]
2022-10-03 09:30:42 +02:00
Jan Lysý
58d32a68fb
Use processedAt from the correct model
...
[MAILPOET-4685]
2022-09-29 15:19:09 -03:00
Jan Lysý
0551d02815
Add refreshing sending queue
...
Because we are still working with old model on some places, it's necessary to refresh both sides of the relation.
[MAILPOET-4685]
2022-09-29 15:19:09 -03:00
Jan Lysý
2cf3f37f5c
Fix creation notification history records
...
[MAILPOET-4679]
2022-09-26 13:23:28 +02:00
Rostislav Wolny
45257b7b99
Simplify subscribers last engagement migration by ignoring Woo data
...
[MAILPOET-4578]
2022-09-26 10:20:32 +02:00
Rodrigo Primo
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
Rodrigo Primo
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
Rodrigo Primo
d79cecbef2
Replace some of the uses of SendingQueue model with Doctrine
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
ccbdbd3e93
Refactor getNewsletterFromQueue() to use Doctrine instead of Paris
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
4ca656a217
Rename $queue to $sendingTask
...
Doing this for consistency and to make it more clear that $sendingTask
contains an instance of \MailPoet\Tasks\Sending and not an instance of
\MailPoet\Models\SendingQueue.
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
a7d0ad6568
Set the type of all the Newsletter parameters that use the Sending class
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
168ce20a40
Use NewsletterEntity instead of Newsletter model in Links
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
9a92068d5b
Refactor Newsletter to use Doctrine instead of the Newsletter model
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
f6afe987c8
Add return type declaration for Newsletter::prepareNewsletterForSending()
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
68c3277195
Replace Subscriber model with Doctrine in Tasks\Newsletter
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
fd0acbd6cf
Refactor Newsletter to use Doctrine instead of the NewsletterSegment model
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
05664a0c6a
Refactor markNewsletterAsSent() to use Doctrine instead of Paris
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Jan Lysý
bc8be524fb
Use ScheduledTaskEntity instead of Sending
...
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
97801cfe25
Remove usage of Sending::getScheduledQueues
...
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Rodrigo Primo
538647946e
Refactor GATracking to use Doctrine instead of Paris
...
The test class was also refactored.
[MAILPOET-4592]
2022-09-14 10:38:01 +02:00
Jan Jakes
047bd94d98
Implement sending for automation emails
...
[PREMIUM-194]
2022-09-08 09:20:20 +02:00
Jan Lysý
f9261dbeb4
Use constants from ScheduledTaskEntity
...
[MAILPOET-4309]
2022-08-31 13:42:21 +02:00
Jan Lysý
fecb26b3b5
Replace usage ScheduledTask::touchAllByIds with repository
...
[MAILPOET-4309]
2022-08-31 13:42:21 +02:00
Jan Lysý
c1e9f86a32
Remove usage of old model for creating post notification history
...
[MAILPOET-4310]
2022-08-22 11:04:45 +02:00
Jan Lysý
5dfda9f3e2
Move task type const from entity to worker
...
[MAILPOET-4366]
2022-08-19 15:11:23 +02:00
Jan Lysý
bf74a506b7
Replace using Sending::getRunningQueues
...
[MAILPOET-4366]
2022-08-19 15:11:23 +02:00
David Remer
97e160bf67
Fix WordPress.WP.I18n.MissingArgDomain
...
[MAILPOET-4524]
2022-08-09 13:23:16 +02:00
David Remer
218de96024
Fix WordPress.WP.I18n.MissingTranslatorsComment errors
...
[MAILPOET-4524]
2022-08-09 13:23:16 +02:00
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
Rodrigo Primo
73f51523f3
Replace Paris models with Doctrine entities in SubscriberLinkTokens
...
[MAILPOET-4345]
2022-08-04 11:52:57 +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
Rodrigo Primo
8a29519b31
Replace Paris models with Doctrine entities in InactiveSubscribers
...
[MAILPOET-4344]
2022-08-04 11:10:50 +02:00
Rodrigo Primo
261f2eaa25
Replace Paris models with Doctrine entities in Shortcodes
...
[MAILPOET-4364]
2022-08-04 10:55:03 +02:00
Jan Lysý
155445b313
Remove old model from SendingQueue Migration
...
[MAILPOET-4358]
2022-08-01 13:09:20 +02:00
Rostislav Wolny
8d4799b050
Fix models check conditions in sending queue
...
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
Rostislav Wolny
5042cdd15e
Refactor fetching newsletter options in SendingQueue using doctrine
...
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
Rodrigo Primo
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
Rodrigo Primo
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
Sam Najian
fb49ce5ac4
Adjust usage of Renderer::render in SendingQueue\Tasks::Newsletter
...
[MAILPOET-4360]
2022-07-14 13:13:47 +02:00
Jan Lysý
3bd49fbc27
Fix annotation in AutomatedEmails
...
[MAILPOET-4308]
2022-05-19 14:18:18 +02:00
Jan Lysý
5ab04b8b22
Remove usage constant from the old model
...
[MAILPOET-4338]
2022-05-19 14:18:06 +02:00
Brezo Cordero
add4039495
Cast type of meta in SubscribersEmailCount task for backwards fix
...
[MAILPOET-4281]
2022-05-09 13:05:21 +02:00