How to send and email to a Moderator belonging to the same group of the Editor/content (and not to all moderators)

Events happening in the community are now at Drupal community events on www.drupal.org.
mxt's picture

I all,

I'm using Rules, Organic Groups, Organic Groups User Roles (OGUR) and Workflow modules in my web site:
- There are group Moderators and Editors
- Moderators and Editors belonging to a certain Group cannot interact with other Groups Moderators and Editors

I have a lot of rules associated with "Workflow state has changed" event: all works fine, except for a particular rule that doesn't work in the right way: I need that when a Editor put his article in "to approve" workflow state, the system send an email to his moderator.

If I used "Send a mail to all user of a role" chosing "moderators" from list of roles, the email will be send to all moderators of all groups. I don't wont this, I want that the email will be send ONLY to the moderator belonging to the same group of the editor.

I'd need something like "Send a mail to all user of a role (moderators) belonging to the same group of the author user (the editor)"

How I can achieve this?

Thank you very much for your help...

MXT
(sorry for my bad english)

Comments

You're in for a tricky task

itangalo's picture

I've spent some time researching how you can do what you ask for (with Rules). Here's what I've found:

  1. Make a View that shows all moderators in the group of the saved node. Use the node ID as an argument.
  2. Make a Views Bulk Operation list of the View, and add the "send tokenized e-mail" operation. (Requires Token Actions enabled.)
  3. Add a triggered rule that on node save (or whatever) calls the VBO.
  4. Spend the next 4–5 hours figuring out how to (A) pass along the node ID as argument and (B) set all the VBO operation fields with tokens. The former one will be pretty easy if you act on a node save. The latter one will most likely not be pretty easy, and will require some digging in form functions – and this is just to get the names for the variables/arrays you want to populate. Then you'll have to find the content to populate them with.

Best of luck,
//Johan Falk, NodeOne, Sweden

PS: I recently wrote a blog post on combining Rules with Views Bulk Operations. It might be of use. http://nodeone.se/drupal-planet/make-rules-dance-with-views-bulk-operations

I'll try for sure

mxt's picture

Thank you very much spending time to help me, I've appreciated it very much.

Also I read your blog post: it's very useful and helped me to understand potentiality and mechanisms using Rules in combination with Views Bulk Operations.

I'll try your suggestion: It seems quite complicated for my skills, but... I'll try!!!

Thank you very much

MXT

First problem

mxt's picture

How I can do this:

1. Make a View that shows all moderators in the group of the saved node. Use the node ID as an argument.

If I haven't OGUR user roles filters and fields? Notice that OGUR roles are different from CORE roles. How I can retrieve users with a specific OGUR roles?

I've already made a feature request in og_user_roles issues: http://drupal.org/node/729256

Thank tou very much!

MXT

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: