Commit Graph

143 Commits

Author SHA1 Message Date
Mustapha Hadid
df171fdcc7 Add JSON endpoint for CAPTCHA rendering
To be used inside WP/WC registration form to construct URL for CAPTCHA page.

[MAILPOET-6325]
2024-12-17 13:56:00 +02:00
Rostislav Wolny
55f2d83abb Prevent resending emails in case the email is not active
Automation email needs to be active in order to be sent.
If we allow resending to inactive emails, we would need to activate them first,
but this could be an unexpected side effect. And activating may cause sending other paused tasks as a side effect.
I expect the email to be active in the majority of cases, so users should not meet this notice very often.
[MAILPOET-6241]
2024-12-09 13:31:49 +01:00
Rostislav Wolny
79de8cc17c Set proper status when resending activable newsletter type
[MAILPOET-6241]
2024-12-09 13:31:49 +01:00
Rostislav Wolny
e6abec74d4 Refactor SubscriberFinder::addSubscribersToTaskFromSegments to return void
We removed the return value to prevent us from using it to check if there were recipients.
It is not 100% reliable for that purpose because it returns 0 for a repeated call.
[MAILPOET-6346]
2024-12-02 11:45:10 +01:00
Rostislav Wolny
3fbff8c83f Optimize newsletter reactivation
When reactivating a newsletter with many queues (e.g., a welcome email with a long history)
NewsletterEntity::getQueues may fail because it attempts to fetch all queues and instantiate
many entity objects.

In this commit, I optimize this by looking only into unfinished queues.
getUnfinishedQueues look for where countToProcess is higher than 0.
We set the count for welcome emails when we create a new queue
see f1ffc77bf3/mailpoet/lib/Newsletter/Scheduler/WelcomeScheduler.php (L140)
[MAILPOET-6310]
2024-11-11 12:21:22 +01:00
Pavel Dohnal
55f21e8cd7 Fix inactive notifications clog sending queue
[MAILPOET-6259]
2024-10-28 11:09:57 +01:00
Rostislav Wolny
3e27192f83 Move fix for missing confirmation email hash to migrations
[MAILPOET-6273]
2024-10-21 11:25:13 +02:00
Pavel Dohnal
3d2ad79931 Ensure the newsletter has hash before preview
[MAILPOET-6273]
2024-10-21 11:25:13 +02:00
Mustapha Hadid
8f95229288 Remove no longer used class parameter 2024-10-14 13:30:16 +02:00
Mustapha Hadid
73e8ad717d Use controller over service to get authorized emails
A preliminary step to enable caching authorized emails data from the API
2024-10-14 13:30:16 +02:00
Jan Jakes
f483d40c19 Clean settings cache when reinstalling the plugin 2024-09-13 10:34:55 +02:00
Rostislav Wolny
f3d6813d97 Load data inconsistencies async from API
[MAILPOET-6219]
2024-09-11 15:19:35 +02:00
Rostislav Wolny
33f4b2d729 Replace usage of WP's current_time without gmt parameter in libs
This commit replaces usages by Carbon::now or in case we need a timestamp it
keeps current_time but adds the gtm parameter as true.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
Jan Jakes
0584c63180 Replace old model table name constants with Doctrine repositories
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
Rostislav Wolny
f022cc23fc Allow pingBridge endpoint for all users with access to the plugin admin
We call the endpoint on the admin pages and the restricted access was causing
that editor users were getting false error notices.
[MAILPOET-6189]
2024-08-14 11:54:28 +03:00
Rostislav Wolny
cb5f533e54 Add API for fixing inconsistent data
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
 Ján Mikláš
4af5720741 Refactor help endpoint
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
 Ján Mikláš
5253d79e81 Use types in new class properties
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
 Ján Mikláš
5847918409 Return 400 instead of 404 in Help API
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
 Ján Mikláš
88c0836443 Create endpoints to cancel and reschedule tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
alex-mpoet
a6caf0a1e6 Add bridge ping endpoint
[MAILPOET-6030]
2024-06-12 11:16:51 +02:00
alex-mpoet
c59ae2d82c Add cron pinging endpoint
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
John Oleksowicz
6675a616b5 Display proper notices for segment actions
This updates some of the segment listing messages to include the name of
 the segment to avoid confusion, and allows for the possibility that
 bulk actions will work for some segments but not all, in which case we
 need to show both success and error messages.

MAILPOET-5395
2024-04-24 12:59:37 +02:00
Mike Jolley
435f638011 Apply rules on lib dir 2024-03-21 16:57:59 +01:00
Jan Jakes
4b3744717f Revert "Unify responses of newsletter editing API methods with get()"
This reverts commit e0b6cf7b41.

In the next commit, I will add a different fix for this issue.

[MAILPOET-5833]
2024-02-05 13:28:15 +01:00
Jan Jakes
d6da2af55b Extract newsletter bulk delete logic to a controller
Repositories shouldn't inject other repositories. Also, this solves circular DI dependency.

[MAILPOET-5845]
2024-02-02 12:48:40 +01:00
Rodrigo Primo
19b33e15f5 Refactor SendingQueue::add() to use Doctrine instead of Tasks\Sending
[MAILPOET-5684]
2024-01-31 12:21:54 +01:00
Brezo Cordero
ab23a01423 Modify the check for sender address
to implement rule for existing campaigns.

[MAILPOET-5832]
2024-01-20 13:39:23 +05:00
Jan Jakes
e0b6cf7b41 Unify responses of newsletter editing API methods with get()
[MAILPOET-5779]
2024-01-16 18:15:35 +01:00
Brezo Cordero
1162b5aca1 Verify sender Address on newsletter activation
[MAILPOET-5786]
2024-01-15 19:34:21 +05:00
Brezo Cordero
5735d21e4d Remove isDomainDmarcRestricted
[MAILPOET-5782]
2024-01-14 19:37:36 +05:00
Oluwaseun Olorunsola
b3665fd1bc Replace ReactStringReplace with createInterpolateElement
MAILPOET-5162
2023-11-02 17:09:49 +01:00
Oluwaseun Olorunsola
4dba4f8b6a Add KB link to the error message "Your MSS key is already used on another site"
MAILPOET-5162
2023-11-02 17:09:49 +01:00
Rodrigo Primo
d4a80c7230 Move SendingQueueEntity::toArray() to SendingQueuesResponseBuilder::build()
Based on a suggestion during the review of the PR, it was decided that
it makes more sense for the code that was created as
SendingQueueEntity::toArray() tp be moved to
SendingQueuesResponseBuilder::build(). It is used only to build the
format that is send in the API response.

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
508fdd7756 Refresh Doctrine entities in SendingQueue::add() to avoid issues
Since SendingQueue::add() still uses Paris, it was running into some
problems caught by our integration tests since some Sending methods
where refactored to Doctrine. The issue was that we started loading some
Doctrine entities earlier, then Paris code inside SendingQueue::add()
would change the same rows, causing the Doctrine entities to contain
stale data. To workaround this problem, in this commit, we are making
sure that the Doctrine entities are refreshed after they are changed by
Paris.

I considered refactoring SendingQueue::add() to use Doctrine but I
wasn't sure what to do with SendingTask::create() and
SendingTask::createFromQueue() so I decided to take a different
approach.

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Rodrigo Primo
dc1cee5118 Replace Newsletter model with NewsletterEntity in SendingQueue
This was the easiest way to fix failing integration tests related to
updating some Sending methods to use Doctrine instead of Paris. Using
Paris in SendingQueue to update the database was creating a state where
Doctrine had stale data and this was causing the tests to fail.

[MAILPOET-4368]
2023-10-25 21:09:39 +02:00
Jan Lysý
ea4f4b1003 Remove temporary fix for Newsletters
[MAILPOET-5563]
2023-10-11 11:26:22 +02:00
John Oleksowicz
a2d04e93c5 Add endpoint to retrieve count for multiple segments
MAILPOET-5510
2023-10-04 12:59:38 +02:00
Brezo Cordero
eaf82fce3f Improve naming of symlink constant
[MAILPOET-5435]
2023-09-25 03:18:34 -07:00
Brezo Cordero
d0e72c8fa8 Ignore exceptions when symlink premium
This is a nice to have and should not block the installation.

[MAILPOET-5435]
2023-09-25 03:18:34 -07:00
Brezo Cordero
2d31cc4bc4 Symlink premium if Dotcom platform
[MAILPOET-5435]
2023-09-25 03:18:34 -07:00
Jan Lysý
26417bab52 Change Coupon API parameter from include_coupon_id to include_coupon_id
[MAILPOET-5123]
2023-09-25 02:28:51 -07:00
Jan Lysý
79d506ca34 Create new API endpoint for WC coupons
Because I haven't found an easy way how to use WP or WC API,
I decided to create a MailPoet endpoint for getting coupons that
allows me loading them via Ajax.
[MAILPOET-5123]
2023-09-25 02:28:51 -07:00
John Oleksowicz
38e709e3b1 Filter subscribers when creating scheduled tasks
MAILPOET-5509
2023-08-31 14:16:10 +02:00
John Oleksowicz
3b7c23262f Display subscriber stats for different time periods
MAILPOET-5508
2023-08-31 13:17:34 +02:00
John Oleksowicz
06df45bb55 Refactor subscriber stats to accept startTime param
MAILPOET-5508
2023-08-31 13:17:34 +02:00
Rostislav Wolny
ce6a5a6a66 Do not save newsletter templates when for Gutenberg emails
This will be disabled to prevent saving empty templates.
We will decide how/if we support templates in the future.
[MAILPOET-5365]
2023-08-24 15:44:34 +02:00
David Remer
76c299c3d7 Remove global count methods.
In the previous commit, we removed the global count for our output. This commit removes
the logic as the only places where it was used was in recalculating the cache and since
the last commit, we do not use this value anymore

[MAILPOET-4487]
2023-08-18 13:35:13 +02:00
John Oleksowicz
5f84d5af1c Add engagement summary to subscriber stats
MAILPOET-5410
2023-08-11 16:39:57 +02:00
Jan Lysý
577a82ca49 Add bulk action for removing tag from subscribers
[MAILPOET-5454]
2023-07-13 13:12:56 +02:00