It would be good to integrate signup with the notifications module, if it was available, to allow users to automatically subscribe to nodes they have signed up for. This would allow them to be notified if there were changes to the nodes.
When a user enters their details to signup for a node, they could check or uncheck a box (depending on a site-wide, or perhaps node-based default) which allowed them to opt in or out of notifications.
This could alternatively be implemented by signup itself, like signup reminders and confirmations, or also through actions and triggers. Doing it in signup itself could have the added benefit of allowing users to re-confirm their signups if the dates change, for example. Do you have any thoughts on the best way to implement this?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 357632.signup_status_notifications.patch | 4.87 KB | geodaniel |
Comments
Comment #1
geodaniel commentedMoving this over to signup status module as I think we should implement it as a sub module there.
Attached is a proposed initial module which allows a site admin to choose which signup status codes should trigger automatic subscription to notifications of node updates, and subscribes users to notifications if they signup using one of the selected signup status codes (e.g. subscribe them if they are going to attend, but not if they are not).
Users are only auto subscribed through the signup form at present (not the signup edit form). There is no automatic unsubscribe if they cancel their signup or edit it to change the signup status to one that doesn't automatically subscribe users.
Comment #2
miglius commentedI have committed your code to the cvs with small changes:
* made use of hook_signup_status() hook provided by the signup_status module
* added configuration option if a subscription should be deleted when the signup is canceled
Could you please test if it works as expected?
Comment #3
geodaniel commentedThanks Miglius. I'm glad you changed that to use the hook instead of the form alters, it keeps it much cleaner. It works mostly, but there are a couple of issues I spotted:
- unsubscribe on cancel (or change) didn't work when I had a status set to one other than those that trigger automatic subscriptions.
- if deleting a subscription when changing signup, we don't know if that subscription was one that they added before they signed up. They may still want to stay subscribed, even though they are canceling their signup. That's one of the reasons I didn't touch that in the initial patch :)
- we should probably still tell the user they have been (un)subscribed to the node on signup (or signup cancel) so they know what's happening. Perhaps that would be a simple way of avoiding having to deal with the edge case above.
Comment #4
miglius commentedI have added a drupal message which is printed out when a user is subscribed/unsubscribed to the node.