Assign user to a node - send email notification when saving
Dear Drupal community,
NOTE: This is not a question for direct help but rather a possible layout for a solution. Just in case reading it would waste your time, so be warned. ;)
I've been working with Drupal for the last six months and developed a few rather small modules for an institution website. One of these modules is defining a content type (with about 30 additional fields) and is featuring the possibility to assign a node of this content type to a specific registered user. When assigning a node to an user and saving the node, an email is send to this user to notify him/her of the assignment (so he/she can do whatever is necessary next). Only the author of the node and this assigned user are allowed to edit the node (besides the super admin, of course).
The institution found this possibility very helpful and wants to set it up for _all_ content types (around 15 different ones are defined). They also not only want a dropdown with all registered users but additionally a text field where a short message can be entered (i.e. a description of the next task) which shall be included in the notification email.
Now I don't want to define all content types by writing separate modules for each of them (since most of them have standard layout [title/body] without any additional fields). So my plan is either to use a combination of existing modules to achieve this or to write a new module that adds the requested features to content types (in general).
By googling and searching on drupal.org I found several suggestions to assign an user to a node with the appropiate permissions.
By using CCK, a user reference field could be added to each content type. The access to nodes could be managed by Node Access User Reference module.
By following this short guide it should be possible to notify the referenced user by mail. By adding an additional field (textarea) to the content types a notification message could be entered by authors/editors and also be used by the mail action trigger combo. Further, the additional fields should of course be hidden for normal display as they are intended for internal workflow. This may be done by using simple CSS.
So, I'll try that first, of course, prior to starting a new module. I'll post my experience here in case others seek similar solutions (i.e. see here, here, here and here).
However, if anybody can think of a different approach which may be easier, faster, more logical or whatever, please point me in the right direction.
Further, if anybody thinks this functionality could be a module of its own (and then maybe adding features such as pre-defined messages/tasks, multiple user assignments and more) please post a comment here and what you would like to see in such a module.
Thanks for reading,
sin

Combining different existing modules
Going beyond the horizon...
Note: Other modules may be required by those modules.
And that's pretty much it. Repeat the steps for all content types you want to have this feature on and you're done. I think this a pretty neat combination of modules.
Regards,
sin
Hi, great tutorial, thanks!
Hi,
great tutorial, thanks! Add on can be to use the cck email field, and it it to the rule.
I do not understand why you need extra access modules though?
greetings, Martijn
Greetings,
Martijn
if you appreciate e-development work, please place a link from your site to www.trekking-world.com
Hey Martijn
Hey Martijn,
for the actual goal of sending a note to the assigned user upon saving a node I indeed do not need to use any access control module. But in my special case this actually the origin of the whole idea. I have content types which only users can edit who either created it or have are assigned to it. So without checking for newly assigned content every day the user gets notified by mail just upon the time when a node is assigned to him/her.
Best,
sin