Mysql unsubscribe users from only one list

Hi all,
I wonder how to unsubscribe user from only one list, the sql way.
Maybe there is an other an easier way to do it, please let me know.

I tried :

delete from phplist_listuser lu 
inner join phplist_user_user uu on lu.userid=uu.id
where lu.listid=XXX
and lu.userid in
(
    select id from phplist_user_user uu
    where uu.email in 
(
... emails ...
)
    as tmpTable
)
order by uu.email;

but this request does not unsubscribe the users.
Thanks by advance

Bruno

1 Like

@bvphp Instead of using sql you can use the Subscribers plugin https://resources.phplist.com/plugin/subscribers#action_subscribers

2 Likes

Hummm,
that seems to be exactly what I need but, I tried to install your plugin, and am now facing an other problem about plugins install … arf
Anyway thanks, I’ll tell you back

@bvphp You can use this sql to do the job

DELETE lu
FROM phplist_listuser lu
JOIN phplist_user_user u ON u.id = lu.userid
WHERE u.email IN('xxx@yyyy.com', 'zzz@yyyy.com')
AND lu.listid = 99
1 Like

Thank you for all duncanc,
I finally installed your plugin and it works !
It is really a useful feature.
Bruno