If you have a newsletter with some 20,000 users, and noticed that ~5000 of them are dead emails or spam related, you have them as a list, and need to delete them at once, the easiest way is to do it manually. The way I got the list is with little coding to filter out the ~10,000 "Delivery Faliure" emails I got in return.
I use navicat for the mysql UI, but you could use anything.
You need to delete from 2 tables. simplenews_subscriptions, and simplenews_snid_tid. The easiest way is to find the link between them, which is the snid.
So, step 1, get the snid of the offending emails you have. I'll only write 3 bogus emails, but you can put thousands there instead, just make sure the last one doesn't end with a comma as shown
SELECT ss.snid FROM simplenews_subscriptions ss WHERE ss.mail IN (
'foo@foo.com',
'bar@bar.com',
'asdf@asdf.com'
);
You'll get a list of snid now. Export them to a .txt file or whatever, and wrap them between single quotes, and end them with a comma, so you can use them in the next queries.. So
23
34
45
becomes
'23',
'34',
'45',
...
Next, delete the offending records from the two tables. Again, put as many as you have, leaving the last one with no comma as shown,
DELETE FROM simplenews_snid_tid WHERE simplenews_snid_tid.snid IN (
'23',
'34',
'45'
);DELETE FROM simplenews_subscriptions WHERE simplenews_subscriptions.snid IN (
'23',
'34',
'45'
);There are 100 other ways, maybe even better, than this way to do the job, but this way works. I hope to find a feature that will do the above, built into the module some day.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | simplenews.200512_2.patch | 6.02 KB | sutharsan |
| #3 | simplenews.200512_1.patch | 9.09 KB | sutharsan |
| #2 | 200512.patch | 2.44 KB | roychri |
Comments
Comment #1
sutharsan commentedComment #2
roychri commentedHere is a patch that allow you to delete a huge list of subscribers based on a list of email addresses that are separated by white spaces (newlines, regular spaces, tabs).
This adds a new secondary local task labeled "Mass Delete" right next to "Export subscriptions".
When you click on "Mass Delete" you see a textarea where you can enter (or paste) a list of email addresses that you want deleted from the simplenews subscriptions tables.
It uses the existing delete function that works on the users list where you can click on checkboxes.
Like that other feature, it put the list of snids (after verifying them) in a sessions variable which is then handled by the function "simplenews_subscription_multiple_delete_confirm()".
Comment #3
sutharsan commentedroychri, thanks for the patch. I used your idea, but implemented it differently.
The attached patch adds a 'mass unsubscribe' page to the subscription management. This gives the flexibility to unsubscribe. When unsubscribed from all newsletters, the data will also be removed from the database. At the same time I made textual changes to the import (now 'mass subscribe') and export pages.
Note that this patch is for HEAD (6.x compatible) and not for 5.x. It will not be implemented in 5.x.
Patch committed.
Comment #4
sutharsan commentedWrong patch.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
boabjohn commentedPerhaps I don't understand how this is supposed to work, but in the latest 6.x-2.x dev,
- I have a list of subscribers and wish to mass delete them. First problem is how to "select all" from the interface at: admin/content/simplenews/users/list
- If we have say 35 pages of subscribers, then we decide to first use Export to collect all the addresses.
- Then pasting this list back into Mass Unsubscribe, ticking all newsletters to make sure no one is subscribed to anything
- We get confirmation of 35 pages of unsubscriptions
- Go back to the simplenews/users/list and ?? all 35 pages of (ex) subscribers are still there.
- Using the filter to only show subscribers to a specific newsletter (which there should now be none), I still get 35 pages of emails listed.
So question: What is the mass unsubscribe supposed to do?
Is there no concecpt of "delete these email addresses" which is where this thread seemed to start?
I had to drop the tables to clear out my 35 pages...my client is not going to be able to do that: they need to have something that *mass deletes* entries from the simplenews/users/list
What am I missing?
Thanks.
Comment #7
sutharsan commentedYes you are missing several points. This is issue about 7.x This issue is a feature request. And you have missed #784686: Unsubscribe-link works but it doesn't unsubscribe. But the most important thing you have missed is that this is not Are you being served. If you have a problem create an issue explain your problem, but if there is no help or you don't like the answer the only thing left is to scratch you own itch or hire someone to scratch. That's the way it works.
Comment #8
boabjohn commentedHi Sutharsan,
Thank you for the pointers.
- Despite having searched, I missed the post froom krabbe and your response.
- Based on your comment at #3 above, I was under the impression this was relevant to 6x as well.
- Since I was under the impression that the module sort of works as advertised, I assumed it was my problem not the code's, so the issue was more appropriately a support request rather than feature.
- As a feature request, not sure why it had been marked closed.
- I'm completely satisfied (amazed actually) at how generous this community is.
- I do hire experts to help solve my problems and am especially happy when my investment also benefits the Drupal community at large.
Changing back to feature request...and fixing typo in title.
Comment #9
simon georges commentedThere is a "mass unsubscribe" on 6.x-2.x as well. Closing this issue.