Posted by protoplasm on May 22, 2011 at 11:41pm
Essentially I want to duplicate the sitewide messaging notification functionality the private messages module. Instead, I want this clickable message (that takes an OG member to the post) to persist until a new comment or node in a specific OG is read by a member of that group. Then it disappears. Is this possible with the rules module?
I can easily create a sitewide message that doesn't persist, but how would you keep it present just for each OG member until it is read?
If this isn't doable with rules, is anyone aware of a module with this functionality?
Thanks
Comments
I don't use OG, but for other
I don't use OG, but for other notifications I have used Rules to
1) assign a Role to a User
2) post a site message if the acting user is assigned a role
3) the role is removed when the action is complete.
I use it to notify people of action which needs to be taken.
My recollection is some tokens did not work in site messages, but it has been a while since I tried it.
how to create actions and register for events to run them?
can you further elaborate how you managed that?
(was it from code or from the rules web pages?)
This is module based, no
This is module based, no custom coding.
We work with the public. Public creates node, we in turn create something and ask them to approve it before sending it out.
So, in the user's node we populate a cck field when we want them to approve something.
Populating the node triggers the action of assigning a role to the user.
Another action triggers an email directing them to the node, where they will see the flag.
As long as the user has the role, this gives them the permission to trigger a flag, which = approval.
Once approval is given, a rule is triggered and the action is given to remove the role, which removes the flag.
As long as the user is assigned the role, there is also a sitewide message. My recollection is when setting this up the token for the sitewide message did not work, though it has been a few months and I could be wrong or it could be fixed.
persistent message until post read
This is more clearly what I am trying to accomplish:
Much like the Private Message module--You have 2 messages. Click here to view your message.
I can generate the message and a clickable link in the message, but the message doesn't persist. It just appears once and then disappears.
What I want to happen is for it to persist until the moderator has actually viewed the corresponding post.
Can I accomplish this somehow with rules?
Yes, flags are the key
Yes, it requires flags that don't have to be visible. Now I just have to make it work.
Well, if it were actually a
Well, if it were actually a Private Message, Private Message Growl is a great module for persistent sitewide notification.
I don't use OG so don't know how well it is integrated with Rules.
I also have an Unread Messages Block which works with PM Growl.
OG
Rules works with OG. You just need to do a rules numerical comparison with a token to identify the group.
The functionality of the persistent sitewide notification of private messaging is really a boon. Our site moderators seem to prefer to use private messaging solely because they like to click the You've got mail notification that PM generates. But I want the private messages to be role-available to future moderators so a group for moderators is the best place. So I need to create the sitewide persistent notification with OG posts and comments if I ever hope to convert them to utilize their group versus private messaging.
Or I could try to convert them to use a dashboard that we also have and use the unread group posts, but it really is about going with the natural flow of what they seem to collectively prefer.
Configuring rules from module code
Can someone give an example of how to use the rules module from another module's code?
Assuming I know the event I want to listen to which is spawned via rules_invoke_event()
how do I register an action to be ran when that event is invoked?