Hello there @make-carlos ,
Thank you for reaching out to us.
$getAllSubscribers = $wpdb->get_results(“SELECT email FROM BeF_mailpoet_subscribers
WHERE status
= ‘subscribed’”);
How can i get user by LIST ID ?
I have total 3 types of list and each list have different users. I can’t see any specific field in table to get by list id
To retrieve subscribers by list ID, you can modify the SQL query to include a condition with the desired list ID. Here’s an example using the code you provided:
$listID = 1; // Replace 1 with the actual list ID you want to retrieve subscribers from$getAllSubscribers = $wpdb->get_results("SELECT email FROM BeF_mailpoet_subscribers WHERE status = 'subscribed' AND list_id = $listID");
Replace $listID
with the actual ID of the list you want to retrieve subscribers from.
Regarding your question about specific fields, the Mailpoet plugin stores the list ID information in a separate table or uses a different column name. You may need to refer to your MailPoet plugin’s database structure to find the correct field to filter by list ID.
I hope this helps.
Have a great day.