Commit Graph

20446 Commits

Author SHA1 Message Date
David Remer
64cbf8a7c0 Ensure signup confirmation enabled
[MAILPOET-5369]
2023-06-02 14:41:51 +02:00
Veljko
5d170b6d5c Fix k6 test by updating the text to items
[MAILPOET-5370]
2023-06-02 13:00:48 +02:00
Veljko
1ec5f84190 Update test to have verification of the updated message colors
[MAILPOET-5320]
2023-06-02 11:24:16 +02:00
Veljko
a8b04a8dca Improve the test to include checks for the blank form
[MAILPOET-5316]
2023-06-01 09:51:50 -05:00
Rodrigo Primo
4209b0dd15 Fix testItDisplaysAnUncheckedCheckboxIfCurrentUserIsSubscribed() test
Two different PRs changed the behavior of the checkbox that is tested in
the failing test: https://github.com/mailpoet/mailpoet/pull/4921 and
https://github.com/mailpoet/mailpoet/pull/4924.

The first PR changed the behavior of the checkbox and thus updated the
testItDisplaysAnUncheckedCheckboxIfCurrentUserIsSubscribed(). This test
class was mocking the method Helper::woocommerceFormField() and that is
why the affected test expected the rendered optin checkbox field to be
empty.

But https://github.com/mailpoet/mailpoet/pull/4924 changed how the
checkbox is generated, stopped using woocommerceFormField() and removed
the mock
(https://github.com/mailpoet/mailpoet/pull/4924/files#diff-6b8e70b6fb9886a41b8ca1040c4e455184f6d2436458d4579b5f8e5eeb9e666fL52).
That is what made the test start failing. Now that the mock is
not used anymore, we should check for the actual string instead of
empty.

[MAILPOET-5368]
2023-06-01 11:51:13 -03:00
David Remer
565959f28c Unify escaping of the attribute
[MAILPOET-4632]
2023-06-01 13:20:31 +02:00
David Remer
a5899895a8 Check if we have proper variables for padding and colors
[MAILPOET-4632]
2023-06-01 13:20:31 +02:00
Rodrigo Primo
0d3293be52 Remove Subscribers\Source::setSource()
I found this method in the context of a ticket to refactor Paris code to
Doctrine. As far as I can tell, it is not used anymore and it is
safe to delete it.

It was added in 1af5802 and was used only inside
Models\Subscriber::subscribe(). Then subscribe() was moved to
Subscriber\SubscriberActions in 7528f0f. Finally, commit 7db2384
refactored SubscriberActions removing the only two calls to
Source::setSource().

The test class SourceTest is removed as well as its only purpose was to
test Source::setSource().

[MAILPOET-5345]
2023-06-01 12:06:14 +02:00
Rodrigo Primo
b2de15add7 Update tests now that woocommerce_form_field() is not used anymore
[MAILPOET-4133]
2023-06-01 11:38:54 +02:00
Rodrigo Primo
206bd7fbab Fix layout error in the optin checkbox for some WP themes
This commit fix a layout error in the optin checkbox that MailPoet adds
to the WooCommerce checkout when the site is using the themes Twenty
Twenty-Two and Twenty Twenty-Three.

This problem was happening because WooCommerce add CSS to make its own
checkboxes work with those two themes, but it broke checkboxes the
layout of checkboxes created with woocommerce_form_field().

The Woo checkboxes in the checkout display the text inside an <span>
element and that doesn't happen for checkboxes created with
woocommerce_form_field(). The problem is in those CSS rules:

0ea5205672/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss (L731-L757)

[MAILPOET-4133]
2023-06-01 11:38:54 +02:00
David Remer
c7ef1c3443 Release 4.17.1 2023-05-31 10:19:30 +03:00
alex-mailpoet
e38fd951d1 Check indexes exist when adding them
[MAILPOET-5364]
2023-05-31 10:19:30 +03:00
Rodrigo Primo
bcf57de500 Remove remaining uses of Subscriber model in SubscriberExporterTest
[MAILPOET-5361]
2023-05-30 11:16:46 -05:00
Rodrigo Primo
1c0f5af55c Remove remaining uses of CustomField model in SubscriberExporterTest
[MAILPOET-5361]
2023-05-30 11:16:46 -05:00
Rodrigo Primo
b98a17bc43 Remove remaining uses of Subscriber model from BuiltInCaptchaValidatorTest
[MAILPOET-5361]
2023-05-30 11:16:46 -05:00
Rodrigo Primo
9e71217acc Remove remaining uses of Newsletter model from TransactionalEmailHooksTest
[MAILPOET-5361]
2023-05-30 11:16:46 -05:00
Rodrigo Primo
87ed5d3b02 Remove remaining use of Newsletter model from RendererTest class
[MAILPOET-5361]
2023-05-30 11:16:46 -05:00
Rodrigo Primo
63f0ee23fa Cleanup code now that defaultStatus is always false
[MAILPOET-4178]
2023-05-30 13:25:24 +02:00
Rodrigo Primo
cd43cfbb1f Fix typo
[MAILPOET-4178]

Co-authored-by: John Oleksowicz <8656640+johnolek@users.noreply.github.com>
2023-05-30 13:25:24 +02:00
Rodrigo Primo
3d88960745 Update automated tests to reflect change in the optin checkbox behavior
[MAILPOET-4178]
2023-05-30 13:25:24 +02:00
Rodrigo Primo
8e6fdddeda Stop marking subscribers as unsubscribed if checkbox is not checked
Before we wanted to makr subscribers as unsubscribed when creating a
subscriber linked to a new WP users if the optin checkbox was not
checked. We are changing this behavior and no action should be taken
when creating a new subscriber with the optin checkbox unchecked. So
this commit removes code that is not necessary anymore from
\MailPoet\Segments\WP::createOrUpdateSubscriber().

[MAILPOET-4178]
2023-05-30 13:25:24 +02:00
Rodrigo Primo
80655813b7 Stop subscribing customers to the Woo list when they are created
This commit changes the behavior of
\MailPoet\Segments\WooCommerce::synchronizeRegisteredCustomer(). This
method is called when a new WooCommerce customer is created. Before, it
would always add the customer to the Woo segment expecting
\MailPoet\WooCommerce\Subscription::subscribeOnCheckout() to unsubscribe
the customer if the optin checkbox was not checked.

Since the behavior of the latter method changed in a previous commit and
it doesn't unsubscribe customers anymoreif the option checkbox is not
checked, the former method had to be updated to only subscribe the customer
if not in checkout context or if in checkout context and optin checkbox is
enabled and checked.

[MAILPOET-4178]
2023-05-30 13:25:24 +02:00
Rodrigo Primo
d6e0768e1f Change the behavior of the optin checkbox in the Woo checkout
This commit changes the behavior of the optin checkbox that MailPoet
adds to the WooCommerce checkout.

Now the checkbox is not checked by default for logged in users who
already subscribed to a list. Also, users won't be unsubscribed anymore
and have their global status change to unsubscribed if they uncheck the
checkbox.

The only action that is performed after this change is to subscribe
users if they check the checkbox.

This change was implemented both for the normal checkout and the block
checkout.

It was also necessary to remove the AutomateWoo integration that
depended on subscribers being unsubscribed during checkout.

[MAILPOET-4178]
2023-05-30 13:25:24 +02:00
Veljko
9ddc2cb3e9 Improve the test to use list selection block more efficiency
[MAILPOET-5315]
2023-05-30 14:24:15 +03:00
Rodrigo Primo
cc03b21e32 Add return type to verifySubscriber()
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
7a82270769 Add types to verifyWPSubscriber() based on PR reviewer feedback
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
bb2c77de31 Simplify verifyMailpoetSubscriber() by setting types in the signature
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
06a2c4e2bc Refactor Scheduler to use SubscriberEntity instead of Subscriber model
It was necessary to add a call to SubscribersRepository::remove() to two
integration tests to make sure Doctrine cleared its internal cache.
Maybe this should be handled by SubscribersRepository::bulkDelete().

[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
b251fa8ee9 Replace SubscribeSegment model with Doctrine code in Scheduler
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
6da2b5ad82 Refactor Scheduler::process() to use Doctrine
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
2ea8309908 Refactor processScheduledAutomaticEmail() to use Doctrine
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
e24d12f641 Refactor verifyMailpoetSubscriber() and verifyWPSubscriber()
Refactor those two methods to use Doctrine instead of Paris.

[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
fcc2f93d91 Refactor deleteQueueOrUpdateNextRunDate() to use Doctrine
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
5e9b820607 Refactor processPostNotificationNewsletter() to use Doctrine
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
0c74a5ae8c Refactor processWelcomeNewsletter() to use Doctrine
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
3b46668784 Refactor processScheduledStandardNewsletter() to use Doctrine
[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
Rodrigo Primo
ca3b5032ca Replace Newsletter model with NewsletterEntity in SchedulerTest
Temporary code was added to Scheduler to make some of its methods work
both with a Newsletter model and a NewsletterEntity.

[MAILPOET-4370]
2023-05-30 13:12:29 +02:00
alex-mailpoet
c73bb345a8 Release 4.17.0 2023-05-30 13:49:14 +03:00
Jan Lysý
81df5f16a2 Add mock for getNewsletter to newsletter coupon spec
[MAILPOET-5125]
2023-05-29 11:27:16 +02:00
Jan Lysý
01035ccd9a Make coupon overlay visible only for generated coupons
[MAILPOET-5125]
2023-05-29 11:27:16 +02:00
Jan Lysý
1ed3dbd3ce Differentiate coupon block's hover message by email type
[MAILPOET-5125]
2023-05-29 11:27:16 +02:00
David Remer
dd6bd811d9 Escape strings in attributes
[MAILPOET-4973]
2023-05-29 10:53:38 +02:00
David Remer
09f984689f Make strings translateable
[MAILPOET-4973]
2023-05-29 10:53:38 +02:00
David Remer
b21798589e Show tool tip help for section
[MAILPOET-4973]
2023-05-29 10:53:38 +02:00
David Remer
cb8ca2b986 Make the tool tip sentence a question
[MAILPOET-4973]
2023-05-29 10:53:38 +02:00
David Remer
28b38ef8f5 Add MailPoet info to WooCommerce System Status Report
[MAILPOET-4973]
2023-05-29 10:53:38 +02:00
Veljko
3c2bed1041 Update test and add new newsletter json
[MAILPOET-5309]
2023-05-25 15:16:26 +02:00
Rodrigo Primo
75f8af13be Refactor MetaInfo::getNewsletterMetaInfo() to use Doctrine
[MAILPOET-5344]
2023-05-25 06:52:00 -05:00
Rodrigo Primo
54b693b654 Refactor MetaInfo to use Doctrine instead of Paris
[MAILPOET-5344]
2023-05-25 06:52:00 -05:00
Veljko
d6b3b0adc0 Make a test for duplicating scheduled newsletter and update other tests
[MAILPOET-5310]
2023-05-25 09:49:25 +02:00