Commit Graph

20858 Commits

Author SHA1 Message Date
Jan Jakes
daab7d8c11 Ensure @wordpress/hooks is never installed in multiple instances
This ensures that all methods imported from @wordpress/hooks write to the same
instance and thus "addFilter" used in one part of the code works with "applyFilters"
called in another place.

In the future, we should use DependencyExtractionWebpackPlugin to always access
the window.wp.hooks object rather than bundling @wordpress/hooks with our code.

[MAILPOET-5653]
2023-10-17 12:41:28 +02:00
alex-mpoet
645f6678c5 Release 4.32.0 2023-10-17 13:28:15 +03:00
Jan Lysý
66bf725e2c Update acceptance test for preview
[MAILPOET-5635]
2023-10-16 12:19:15 +02:00
Jan Lysý
fb9a9566f1 Update Gutenberg acceptance test
[MAILPOET-5635]
2023-10-16 10:56:15 +02:00
Jan Lysý
6a3cd53d2d Redesign new editor modal
[MAILPOET-5635]
2023-10-16 10:56:15 +02:00
Jan Lysý
e900b0e9e1 Add button group with dropdown
[MAILPOET-5635]
2023-10-16 10:56:15 +02:00
John Oleksowicz
64624e017b Store sendContextValue in state
MAILPOET-5512
2023-10-16 10:22:22 +02:00
John Oleksowicz
d08343f215 Convert saveDraftNewsletter to async
MAILPOET-5512
2023-10-16 10:22:22 +02:00
John Oleksowicz
cc34ed42db Create variable for new segment URL
MAILPOET-5512
2023-10-16 10:22:22 +02:00
John Oleksowicz
53bc5a2505 Ensure filter segments display for draft/scheduled
This is only tangentially related to this ticket. I noticed during
testing that the filter segment tag was not showing up in listings for
standard newsletters that were drafts or scheduled. This is because
options weren't included in the response for standard newsletters.

MAILPOET-5512
2023-10-16 10:22:22 +02:00
John Oleksowicz
fa86703637 Change to kebab case
MAILPOET-5512
2023-10-16 10:22:22 +02:00
John Oleksowicz
3ee2017bd1 Redirect to send step after creating segment
If the user creates a segment specifically as a filter segment for an
email, we should redirect them to that email's send step after a
successful save.

MAILPOET-5512
2023-10-16 10:22:22 +02:00
John Oleksowicz
003a28e444 Add Create new segment link to filter segment
A note on using context: we need to be able to save the draft of the
newsletter before redirecting users to the segment creation page,
otherwise they might unexpectedly lose their work. The link exists in
a field, so the alternative to using a context seemed to be passing this
 function down as a prop, first to the Form and then to all of the
 fields, whether they needed it or not. This seemed clunky at best, and
 require changes to Form and Fields that get used many other places in
 the plugin.

 Using a context was the cleanest solution I could come up with for
 avoiding those changes.

MAILPOET-5512
2023-10-16 10:22:22 +02:00
David Remer
8fbac3e2c2 Release 4.31.1 2023-10-13 18:09:52 +03:00
Jan Jakes
e9833006ad Fix media library being empty in some cases
[MAILPOET-5656]
2023-10-13 18:09:52 +03:00
John Oleksowicz
43107ac823 Add note about filters to SubscriberTag
MAILPOET-5632
2023-10-13 11:21:42 +02:00
John Oleksowicz
bbb1a133fb Don't allow saving of lookup data to throw unhandled errors
It's not a critical error if we aren't able to save this lookup data,
and we wouldn't want it to interfere with the sending of a newsletter,
but we should log it as an error for debugging purposes.

MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
9b7296979e Don't attempt to use WC functions if not enabled
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
b1dd110bf8 Add lookup data retrieval for used shipping method
For ease of lookup, I changed the helper to return an array with keys
corresponding to the instanceId of the shipping methods. I couldn't see
anywhere else in the codebase where the keys would have mattered.

MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
97a53cb1aa Add lookup data retrieval for used payment method
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
c4fc8649f4 Add lookup data retrieval for used coupon code
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
67cff8992e Add lookup data retrieval for woo product
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
9d8fb08026 Add lookup data retrieval for woo category
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
54461d89ba Add lookup data retrieval for wordpress user role
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
d1f77d3ee5 Add lookup data retrieval for subscribed to list
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
af9a6cbb67 Add lookup data retrieval for subscribed via form
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
40785d047e Add lookup data retrieval for custom fields
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
6da760e754 Add lookup data filter to subscriber tag
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
beda4f8d89 Add lookup data retrieval for email filters
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
984aa81f86 Add lookup data retrieval for automation filters
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
cce390688c Add convenience methods for param retrieval
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
12362c0399 Update filter interface for lookup data
This method is intended to store the actual names of things that might
change or be deleted in the future, so we can include accurate
information when showing what the snapshot of the filter was at the time
.

MAILPOET-5625
2023-10-13 11:21:42 +02:00
Jan Lysý
eace314009 Use wpLocalizeScript instead of wpAddInlineScript in Email editor
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
bc5d0cb203 Use createInterpolateElement instead of ReactStringReplace in send-preview-email
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
5fce014a60 Fix email dataSchema in EmailApiController
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
5b21b74794 Add acceptance test for sending preview
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
2b58bbd7b1 Add displaying error and success message
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
e5e04e63e2 Add sending email after click on button
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
98542966aa Introduce MailPoet store
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
de66b3fea1 Add JS variables for email editor
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
226317f55c Fix creating newsletter in EmailEditor
After removing temporary fix a hash was missing for newsletter created via EmailEditor.php
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
8ede5958b7 Add modal window with input for sending testing email
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
b1eb5ccb96 Add preview dropdown component to new email editor
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
65b6a129ae Add email preview URL to EmailApiController response
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
ea4f4b1003 Remove temporary fix for Newsletters
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
Jan Lysý
ed0417b819 Rename component NextButtonSlot to HeaderButtonSlot
I renamed this component because the name should be more universal for using other buttons.
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
David Remer
17ca776189 Ensure that woocommerce is actually active
[MAILPOTE-5613]
2023-10-11 10:19:24 +02:00
Rodrigo Primo
cde2d6570b Fix displaying default condition when adding a segment
Whenever the user goes to add a new segment, MP displays `WordPress user
role` as the default condition. But there was a
bug that was preventing the default condition from being displayed, if
the user left the page by clicking in the back button, and then returned
clicking again on the `Create custom segment` button.

This bug was introduced in dba4ba4dfc.
It added code to unset the segment when the user left the segment
editing page. This was necessary as, in that PR, we started using the
same store for all the dynamic segment pages. The problem is that the
added code sets the segment to an empty array and actually we need to
restore the initial state which is a segment with the `WordPress user
role` selected as its single filter. This is what is done in this commit.

[MAILPOET-5614]
2023-10-10 17:55:21 +02:00
David Remer
1ced9b69f6 Release 4.31.0 2023-10-10 14:13:29 +03:00
David Remer
d2d465165d Remove double log entries before adding unique index
[MAILPOET-5630]
2023-10-09 13:20:20 +02:00