Hi there @rsmithgs,
I ran some tests on my test site with the latest version of MailPoet (4.48.2) and confirmed that moving the WordPress Users list to the trash does not trash its subscribers if they are subscribed to an alternate list.
I did see, however, that if the WordPress Users list is in the trash, and a new User is added to the site manually or via API — that is, a new User account is created on the site directly, not through a MailPoet subscribe form – then this new user is added automatically to the trash, in “unconfirmed” status and on no lists.
This email can then subscribe to a list through a MailPoet form and is moved back to Subscribed status (not trashed) and added to the new list.
So it seems like perhaps the API interaction here might be an issue, if it is creating a user account directly first, and then adding to list afterwards and possibly skipping some steps that the form would usually take care of.
Please test a manual process here to confirm. If you can create a WordPress User and have them sign up via a MailPoet form and have it work correctly, please review your external form and API calls to make sure they are following all required steps to add a subscriber to a list.
Hello @lynnjat7,
Thank you for your quick response! Are you saying that when a new user is created they are immediately put in the trash because the WordPress Users List is trashed and they are automatically applied to that list?
My process is, that someone signs up and creates an account on my site, and then when they do a membership checkout I assign them to the Newsletter list through an API call.
Since the user creates an account they should already exist in MailPoet so it should bypass a large part of code and always be running the else line:
// Check if subscriber exists. If subscriber doesn't exist an exception is thrown
try {
$get_subscriber = $mailpoet_api->getSubscriber($subscriber['email']);
} catch (\Exception $e) {}
try {
if (!$get_subscriber) {
// Subscriber doesn't exist let's create one
$mailpoet_api->addSubscriber($subscriber, $list_id_arr);
} else {
// In case subscriber exists just add him to new lists
$mailpoet_api->subscribeToList($subscriber['email'], $list_id);
}
} catch (\Exception $e) {
$error_message = $e->getMessage();
}
But my users are not being removed from the Trash after they subscribe, so I assume they aren’t getting any actual emails besides the double opt-in email required to use MailPoet Sending Service.
Is there another line I need to add to check if they are in the trash, and if they are, remove them from the trash before subscribing them to my list?
Hi again @rsmithgs,
Are you saying that when a new user is created they are immediately put in the trash because the WordPress Users List is trashed and they are automatically applied to that list?
Yes, this is what I’m seeing on my test site. I’m not sure this is how this should be working, however; it seems to me that the new subscriber should be added as not-trashed but unconfirmed or unsubscribed.
I have reached out to our development team to take a look at the code here to verify how this should be working, and if there is any workaround from the API side. There’s no API call to set a subscriber as “not trashed” as far as I can tell, so the process you are following here seems to fall into a grey area.
Please do note that debugging API code falls outside our scope of support but this specific case does seem like it might be a bug, so I will report back on what our development team has to say; but if custom code is required to resolve the issue, that would fall outside scope.
In the meantime, if you reactivate the WordPress Users list, this would likely serve as a workaround in this case for the time being. Are you able to do that as a test?
Hi again,
As my colleague shared above we have notified this issue to our developers and they are checking it.
We still don’t have an ETA for the fix but we have added this thread to the report and we’ll update you here as soon as we have any news.
Thank you @lynnjat7 and @danielinhou for confirming that this is a replicable issue. Since this seems to be an issue that is secondary to whether the API code works or not, I believe this would still fall under support right?
There’s not an ETA, but is this forum correct place to keep an eye out for a solution or timeline to a solution?
Hi again @rsmithgs,
Sorry for the delay in our response, but wanted to update you that the fix is now in. It was submitted for this week’s release which came out yesterday, version 4.49.1.
Please update when you are able and give the new version a test run. What you should see happening now is that newly added WordPress Users (via API) are still added as trashed/unconfirmed when first created, if/when the WordPress Users list is also trashed. However, these should now move to active (i.e. not trashed) status and subscribed when you use the API call to subscribe them.
Please do let us know if you are still seeing issues.
Hello @lynnjat7, thank you so much for this update! I had a question though. Will the update change current subscribers that are Trashed and Subscribed? Or will I need to manually untrash those users and the update will only work for WordPress Users going forward?
Hi there @rsmithgs,
As the currently trashed subscribers have already been marked as subscribed, you’ll need to fix them manually, unfortunately. The fix applies when the API is used to mark the trashed subscribers as subscribed, but for those users you have already added this way, that fix won’t run.
So, they will need to be manually untrashed, but going forward, future new WordPress Users who are then moved to subscribed with the API should un-trash automatically.
Thank you @lynnjat7, could you tell me if there’s an easy way to export the segment of users in my Trash so I can compare this list to those who have active memberships on my site?
It looks like the Export tool only allows segmentation by List, but even if someone is marked as in a List, if they are in the trash it doesn’t look like those subscribers are exported (at least in the preview number provided).
Hi @rsmithgs,
There isn’t really a way to export Trashed subscribers as they are omitted from the export files by default, and there’s no option to include them.
When viewing the MailPoet > Subscribers on the “Trash” tab, you can filter by list if that is helpful:
Full Size: https://d.pr/i/8c1YQs
You’d still have to manually flip back and forth between the filtered list and your membership list – you might be able to create a digital list by copying and pasting.
If you’re handy with SQL you could possibly pull this information out of the database directly but we wouldn’t be able to create a custom query for you like this via this support channel. If it’s a huge list and cross referencing is going to be very difficult, I’d recommend reaching out to a developer to see if they can extract a more concise list from the database for you.
Thank you @lynnjat7,
I successfully moved over the subscribers I wanted from the trash to Subscribed, but I noticed that someone who subscribed today still landed in the Trash and their status changed to Subscribed and they were not moved out.
My WordPress Users List was still in the Trash, but I thought the update was going to make it so that even when this list was in the trash the WordPress Users would initially be placed in the Trash and then once they double-opt in they would be listed as Subscribed and moved out of the Trash.
Restoring and Enabling my WordPress Users list moved all of the Subscribed and Unconfirmed out of the Trash, thus putting me over the 1,000 limit for free accounts (I didn’t plan on this happening because I had some people in the Trash who were marked as subscribed from about 2 years ago that I’m assuming never received an email because they were in the trash. About 200 subscribed and 200 unconfirmed were added from that maneuver).
Is there not a way to Restore the WordPress User List without Enabling it so that WordPress Users are not immediately trashed, but have the option to be subscribed or not? Like I said before, we don’t plan on sending using the WordPress Users list, we just need WordPress Users to be able to be added to other lists that they do subscribe to.
Sorry for the delay, but I wanted to wait a bit longer to confirm it is actually functioning as expected now. I’m still unsure what would have caused the 1 additional person to go to the trash as subscribed, but I can confirm now that WordPress Users are now landing in the Subscribed section and not in the trash.
Hi there @rsmithgs,
Thanks for the update and good to hear that the fix is working! I’ll go ahead and mark this thread as closed. Happy mailing!