1

I feel like I am almost there but I am running into a problem.

I have a contenttype called projects with some users assigned to each project node. When a project node is updated I want to send a notification email to the referenced users.

What I have now is that all users get the email as the content gets updated. enter image description here

Your help is greatly appreciated!

3

I just figured it out, i used a loop that went trough all the referenced users and then I added a action that send an email to every user in the loop.

enter image description here

  • do you know how to loop through the user reference field when there is a node reference involved as well? I have a child node referencing a parent node. The parent node contains the user reference field. I want to send emails to the users in the parent node when a child node is created. More details are here: drupal.stackexchange.com/questions/129607/… – knowledges33ker Sep 13 '14 at 16:37
0

It can be done by using the Rules module and using the user reference field in particular.When one of the fields it has is a user reference and you wish to send an email to that user of that reference each time a node is updated, try using the following piece of code:

// Change $node->field_userreference to point to the correct CCK field    
$recipient = user_load($node->field_userreference);
return $recipient->mail;

Another option is: Add the action Load a referenced user and select the user you want to load in the DO section. Give it a name if you want, otherwise it will default to 'Referenced User'.

Then add another action, Send mail to a user and select the name you chose in the previous step under the Arguments configuration.

0

Have you considered the subscriptions module? It provides the notification on node update functionality you desire, but also allows the users receiving the notifications (subscription preferences) to toggle them off or on, or add them to new nodes too. Hope that can help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.