An unsubscription can clash with a current sending process. This can cause that a user receives a newsletter after he unsubscribed (becuse he was pending recipient in a long-running cron sending task)
Thus when unsubscribing, the mail spool should be cleanup (removing the current user as a recipient).
Affects function simplenews_unsubscribe_user()
I'm considering this a bug because we're not following proper standards (508, spam)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | added_include.patch | 3.18 KB | berdir |
| #1 | clear_spool_on_unsubscribe.patch | 3.11 KB | berdir |
Comments
Comment #1
berdirAttached patch adds this including simple test coverage.
Note that I renamed simplenews_clear_spool_from_node($node) to simplenews_delete_spool(array $conditions) to a) allow different conditions than just a node object and b) differentiate the function from simplenews_clear_spool(), which just deletes *old* records which are not used anymore.
Comment #3
berdir#1: clear_spool_on_unsubscribe.patch queued for re-testing.
Comment #5
berdirI hate API functions in optional include files :) We really need to move stuff that can be used as API functions by other modules and ourself. Right now, "module_load_include('inc', 'simplenews', 'includes/simplenews.mail');" is part of the API if you want to send a newsletter, that's just wrong. We currently have that line 12x in our code, all over the place.
Comment #6
miro_dietikerAlmost perfect ... except the comment "Make sure that 100 mails have been sent."
Please change it to 99 and commit.
Comment #7
berdirCommited.