Commit Graph

13768 Commits

Author SHA1 Message Date
Brezo Cordero
a901b1caa7 Remove Subscribers IdiORM Model
[MAILPOET-3820]
2021-11-23 13:54:41 +01:00
Rostislav Wolny
6f5cde2fbf Update counts of sending queue when triggering post notification
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]
2021-11-23 13:39:51 +01:00
Rostislav Wolny
bbb23e4f37 Update also newsletter status when completing sending task
[MAILPOET-3962]
2021-11-23 13:39:51 +01:00
Rostislav Wolny
c8111a7a85 Fix setting processed at when finishing sending within resume
[MAILPOET-3962]
2021-11-23 13:39:51 +01:00
Rostislav Wolny
8e5d7dd917 Unify conditions for triggering cron for subscribers stats report
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]
2021-11-23 12:55:01 +01:00
Oluwaseun Olorunsola
2e02bc36f2 Release 3.74.1 2021-11-23 12:09:21 +01:00
Rodrigo Primo
5c6000bed6 Fix: duplicated entries when exporting subscribers of dynamic segments
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]
2021-11-22 14:33:58 +01:00
Oluwaseun Olorunsola
21792b0a0b Refactor \MailPoet\Test\DataFactories\ScheduledTask to Doctrine
[MAILPOET-3817]
2021-11-22 13:53:13 +01:00
Rodrigo Primo
120aa74511 Fix query to get subscribers of the "has WC subscription" segment
There was an issue in the old query used to get subscribers of the "has WooCommerce subscription" segment. When getting the IDs of the users
that purchased a given subscription, it would get all the entries from wp_woocommerce_order_items without checking the value of ordem_item_type.

The problem is that wp_woocommerce_order_items contains entries for the purchased product, but also other things like shipping and tax information. The WooCommerce Subscriptions extension uses wp_woocommerce_order_items to store data when a user switches from one subscription to another. This was causing users to be included in the "has WooCommerce subscription" segment even after they had switched from the subscription that belonged to the segment to another one.

This problem was fixed by adding another condition to the part of the query that joins with wp_woocommerce_order_items to get only entries that have the value 'line_item' for the field 'order_item_type'. This excludes entries where the value of 'order_item_type' is 'line_item_switched', which is what WC Subscriptions uses to track subscriptions that a user used to have before switching to something else.

[MAILPOET-3898]
2021-11-22 12:53:39 +01:00
Rodrigo Primo
c701f02d27 Pass a copy of the Carbon object to avoid unexpected side effects
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]
2021-11-22 10:52:58 +01:00
Rodrigo Primo
9e334a953a Add integration tests for LastSubscribedAtListener
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]
2021-11-22 10:52:58 +01:00
Rodrigo Primo
2e050d7a32 Pass a copy of the Carbon object to avoid unexpected side effects
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]
2021-11-22 09:58:49 +01:00
Rodrigo Primo
12e326596d Remove unused imported classes from TimestampListenerTest
Found this while working on [MAILPOET-3870]
2021-11-22 09:58:49 +01:00
Pavel Dohnal
5599cfffae Remove old models usage from ReceivePostNotification test
[MAILPOET-3823]
2021-11-22 09:31:03 +01:00
Oluwaseun Olorunsola
e3bd966426 PR review
[MAILPOET-3871]
2021-11-22 09:27:08 +01:00
Oluwaseun Olorunsola
4ec0ac1ecc Scoped styles to iFrame and public form
[MAILPOET-3871]
2021-11-22 09:27:08 +01:00
Oluwaseun Olorunsola
57d4ffa0fc Used instance instead of static method, fix bug with generateHtmlCustomFontLink
[MAILPOET-3871]
2021-11-22 09:27:08 +01:00
Oluwaseun Olorunsola
937589b26d Fixed CSS is not applied when using form iframe
[MAILPOET-3871]
2021-11-22 09:27:08 +01:00
Jan Lysý
7db189acec Add info when form is inactive to the form widget
[MAILPOET-3896]
2021-11-17 15:39:48 +01:00
Jan Lysý
6eeed44735 Add info when form is inactive to subscription form block
[MAILPOET-3896]
2021-11-17 15:39:48 +01:00
Oluwaseun Olorunsola
d630419982 Fixed fixed types error
[MAILPOET-1950]
2021-11-17 15:37:13 +01:00
Oluwaseun Olorunsola
d256d2a235 Fixed acceptance test errors
[MAILPOET-1950]
2021-11-17 15:37:13 +01:00
Oluwaseun Olorunsola
31448d6136 Fixing acceptance test errors
[MAILPOET-1950]
2021-11-17 15:37:13 +01:00
Oluwaseun Olorunsola
975f2e5060 Using longer string for key
[MAILPOET-1950]
2021-11-17 15:37:13 +01:00
Oluwaseun Olorunsola
6c8e248611 Update key display
[MAILPOET-1950]
2021-11-17 15:37:13 +01:00
Jan Lysý
aec3bcd4ef Add check that re-engagement link is not missing
[MAILPOET-3764]
2021-11-17 15:21:31 +01:00
Jan Lysý
5b253e5d30 Use translation function directly
[MAILPOET-3764]
2021-11-17 15:21:31 +01:00
Jan Lysý
cfbcc19dce Add validation on missing re-engagement link
[MAILPOET-3764]
2021-11-17 15:21:31 +01:00
Jan Lysý
e17fb4471d Add template Confirm interest or unsubscribe
[MAILPOET-3764]
2021-11-17 15:21:31 +01:00
Jan Lysý
85e2ebf547 Add template Confirm interest before deactivation
[MAILPOET-3764]
2021-11-17 15:21:31 +01:00
Jan Lysý
db0763af8e Add template category Re-engagement Emails
[MAILPOET-3764]
2021-11-17 15:21:31 +01:00
Pavel Dohnal
cd35b2f72d Release 3.74.0 2021-11-17 13:07:48 +01:00
Rostislav Wolny
325173286e Fix stats reports checks in cron worker trigger
[MAILPOET-3948]
2021-11-17 10:15:28 +01:00
Brezo Cordero
3cf95c7feb Attempt to convert dates using d/m/Y
[MAILPOET-3747]
2021-11-16 11:06:52 +01:00
Pavel Dohnal
78d748948b Make sure the parentheses are correct
[MAILPOET-3938]
2021-11-16 09:54:18 +01:00
Pavel Dohnal
5f1e6c8bd2 Make sure the query always returns at most 1 row
[MAILPOET-3938]
2021-11-16 09:54:18 +01:00
Brezo Cordero
c95557a0ec Remove mixed from test
[MAILPOET-3945]
2021-11-16 09:14:41 +01:00
Brezo Cordero
b254e9c969 Release 3.73.2 2021-11-15 08:38:42 -06:00
Jan Lysý
9e4888dc46 Add tracking unauthorized emails in modal
[MAILPOET-3881]
2021-11-15 15:03:43 +01:00
Jan Lysý
3c8fa566ed Add tracking unauthorized emails when user tries to send
[MAILPOET-3881]
2021-11-15 15:03:43 +01:00
Jan Lysý
73b18d9592 Add tracking for unauthorized emails in settings
[MAILPOET-3881]
2021-11-15 15:03:43 +01:00
Jan Lysý
7d04ea28ad Add meta to response when email is unauthorized
[MAILPOET-3881]
2021-11-15 15:03:43 +01:00
Jan Lysý
eb0fb13f1c Add tracking unauthorized email notice
[MAILPOET-3881]
2021-11-15 15:03:43 +01:00
Pavel Dohnal
9069b680b9 Fix acceptance test
[MAILPOET-3926]
2021-11-15 14:54:06 +01:00
Pavel Dohnal
9323a7a0d8 Fix custom fields label saving for checkbox
[MAILPOET-3926]
2021-11-15 14:54:06 +01:00
Pavel Dohnal
9700e9abbb Fix custom fields label saving for date
[MAILPOET-3926]
2021-11-15 14:54:06 +01:00
Pavel Dohnal
822587e92b Fix custom fields label saving for select
[MAILPOET-3926]
2021-11-15 14:54:06 +01:00
Pavel Dohnal
6b41d4b70b Fix custom fields label saving
[MAILPOET-3926]
2021-11-15 14:54:06 +01:00
Rodrigo Primo
ae99fe3be2 Use Doctrine references when saving links
This commit changes the code of the method
\MailPoet\Newsletter\Links\Links::save() to use Doctrine references
instead of full entities when getting a newsletter and sending queue
entities to save the related links.

We don't need the full entities here, and getting a full entity for the
sending queue was generating an error in the
testItLogsErrorWhenNewlyRenderedNewsletterBodyIsInvalid() integration
test (see the description of PR
https://github.com/mailpoet/mailpoet/pull/3784 for more details).

To be able to get the reference, it was necessary to add a helper method
called getReference() to \MailPoet\Doctrine\Repository.

[MAILPOET-3816]
2021-11-15 13:03:47 +01:00
Rodrigo Primo
ea3b38bc08 Deprecate \MailPoet\Models\NewsletterLink
[MAILPOET-3816]
2021-11-15 13:03:47 +01:00