When we trigger post notification sending we used to create post notification history record,
save all scheduled task subscribers but didn't update counts on queue.
Counts were eventually updated when sending started. This was causing some issues e.g. when sending
got stuck post notification item was showing 0/0 in sending status.
Pausing/resuming such a post notification caused that it was immediately set as sent.
This commit adds updating counts in queue immediately when sending starts.
[MAILPOET-3962]
Having a different condition in the worker checkRequirements was causing
that the cron was attempting to schedule the jog over and over again.
[MAILPOET-3970]
This commit fixes a bug in the code that exports subscribers to a CSV
file. This bug caused duplicated entries when exporting subscribers of
dynamic segments. Instead of a given subscriber appearing only once in the
CSV file, they would be included multiple times, and the number of times
would depend on the number of static segments that they had subscribed to.
This bug was caused by a problem in the code that generates the SQL
query used to fetch the subscribers that will be exported. The same
method is used for subscribers not linked to a segment, static
segments, and dynamic segments. The table wp_mailpoet_segments was
included in the query in the three cases, but it should not be included
for dynamic segments as this type of segment does not have a
corresponding entry in this table. Including this table without
specifying a segment ID (as there is not one for dynamic segments),
meant that MySQL would return an extra entry for a given subscriber for
each static segment that they had subscribed to.
[MAILPOET-3900]
This commit changes LastSubscribedAtListener to pass a copy of the Carbon
object representing the current time to the SubscriberEntity property
lastSubscribedAt. Passing a copy instead of the object itself is needed to
avoid unexpected side effects. Before this change, modifying the time
of this property of a given SubscriberEntity instance could affect the
same field of another instance as the same object used inside
LastSubscribedAtListener for all entities.
[MAILPOET-3946]
This commit adds basic integration tests for the class
LastSubscribedAtListener since it had none and it will be modified in a
subsequent commit. A method from TimestampListenerTest was moved to a
base class since it can be reused in LastSubscribedAtTest.
[MAILPOET-3946]
This commit changes TimestampListener to pass a copy of the Carbon
object representing the current time to the entity properties updatedAt
and createdAt. Passing a copy instead of the object itself is needed to
avoid unexpected side effects. Before this change, modifying the time
of the createdAt or updatedAt field of a given entity could affect the
same field of another entity as it could be the same object used inside
TimestampListener for all entities.
[MAILPOET-3870]
It was also necessary to update two NewsletterTest tests, as after the
change to Links::save(), having a queue ID set became mandatory (before
it was not and one was not set properly in the mock SendingQueue object).
[MAILPOET-3816]
Doing this as part of the task to deprecated old Paris models
(NewsletterLink) and use Doctrine entities instead
(NewslleterLinkEntity).
[MAILPOET-3816]
We allow exporting templates as JSON and templates exported from the older plugin versions use thumbnail key for storing the image data.
[MAILPOET-2686]
We needed to get number of rows which meet the condition.
I couldn't use DQL since it doesn't allow a subquery in FROM
so I rewrote the query using DBAL level query builder.
[MAILPOET-3922]
We discovered that Codeception will regenerate the file during unit testing. Unfortunately, the regenerated file fails lint check which prevents the build from passing on Circleci
We restored the file and left it empty
[MAILPOET-3822]