With my Drupal upgrade from 4.7 to 5, I noted the Notify.module was deprecated and replaced by the Subscription.module. Our organization's members are low-tech computer users. They depend on the volunteer webmaster, me, to automate most of their settings.
Is there a mySQL query I could run in phpMyAdmin to automatically subscribe all current Users to send Interval of daily? Would the query statement need to include the CCK content_types A,B,C for each uid?
Comments
Comment #1
beginner commentedThe exact query would depend on who you want subscribed and how (to all posts, to posts of certain node types, etc.).
What follows is not what you requested, but could equally be documented somewhere. The following script ensures that every one is subscribed to nodes they have posted, and to nodes where they have commented:
update subscriptions by node authors:
Update subscription by comments:
Comment #2
salvis@Ashford: Go to admin/settings/subscriptions/userdefaults to set your preferred default interval.
Create a subscription and then look inside the {subscriptions} table to see what the corresponding entry looks like. Create more of those for your users.
@beginner: Iterating over all nodes or comments has the potential to time out, leaving the database in an indetermined state. An operation as you suggest should use a single SELECT with a JOIN, so that it can be restarted and will pick up where it left off.
Comment #3
roball commentedI am looking to subscribe all users of a certain role to a Category (specific Forums) defined on the User defaults settings. With the Custom subscriptions module, this is possible for the Notifications, but not for the Subscriptions module. Is there a way to do it?
Comment #4
salvisNo, see above.
Comment #5
roball commentedI don't understand. It *is* possible using Notifications, so why it isn't with your module?
Comment #6
salvisNo such functionality is implemented. If you want to implement it, you're welcome to do so, in a separate add-on module. I will help by answering specific questions and reviewing your code.
You might want to look through the issues queue for previous issues where this has been discussed.
Comment #7
elBradford commentedI had a pretty empty subscriptions table and rand the following two queries to set it up for all my users - mine is a pretty unique case but this worked for me:
This seems like it would be trivial to add to the plugin. I am not a mysql guru, it just seems like it would be pretty basic to just apply a basic setting to all users of a role.
Comment #8
salvisWe have a patch in #1249502: Bulk subscribe/unsubscribe operations that would let you do this easily through the GUI, but no one cares enough to test it...
Comment #9
Ashford commentedDeveloper reports a patch is ready for the users to test. See Duplicate Issue http://drupal.org/node/1249502
Don't understand how to do a patch? Look up the Patch Manager module. All you have to do is download the patch file and click a button. Even though Patch Manager also has an Undo Patch button, the experts always recommend that you run updates and patches on a test site first.
Comment #10
elBradford commentedI wish I found that sooner, I would have been glad to test it.
Comment #11
salvisThere will be a D7 version of the patch, so it's not too late...
Comment #12
karingI just used the D6 version of the patch to force-subscribe 420 users of a certain role to a specific Content Type. Worked well - only downside is that you have to navigate through a few screens - but it does the job.
A couple of notes I made testing this (don't mean to complain - just to give you some detailed feedback):
OK, this sounds like I'm complaining - but that's not the case! It would have taken me a lot longer had I not found your -dev version. Thanks a bunch!
Comment #13
salvis@KarinG:
That's very useful feedback, but — could I ask you to put it into a new issue?
"closed (duplicate)" issues are dead ends that should remain dead, because the action has moved elsewhere.
"closed (fixed)" issues should usually remain closed as well, because they achieved their goal (and are typically referenced in a CHANGELOG.txt item). Possible reasons for reopening such an issue could be major bugs surfacing shortly after commit, or if you feel that you absolutely need the attention of all followers of the original thread to continue the discussion.
#12 is about tuning an existing feature, and it should get its own issue number, so that we can discuss it for its own worth and ultimately give it its own line in CHANGELOG.txt.
So, please, click edit, copy your input, and paste it into a new issue.
Comment #14
karingI apologize - didn't look at what it said above - just read your #11 note telling elBradford it's not too late to do some testing. Will re-organize things shortly.