Congratulations for this module, I believe that it s much more user friendly and functional than the other one.
I write to ask if there is a way to create a worflow for comments replies. Let say, that a person replies a comment, I want to send
an email to the user who write the comment saying that someone writes a reply to his comment, even if that person is not the author of the node. Is this posible with workflow-ng?
Thank you in advance.

CommentFileSizeAuthor
#9 notify_on_new_comments.tgz1.09 KBitangalo

Comments

fago’s picture

Title: Comments replies » Comments replies notifications for comment authors
Category: support » feature

It's not possible currently. Perhaps best it would be to write an action, that can inform comment author of replied comments for a given comment - then it would work.

mauro72’s picture

Thank's for your answer, I'll give a try to that.

dwils03’s picture

Version: 5.x-1.0-beta5 » 5.x-2.1

Is there any more support for this? I also am looking to do this exact thing. Has it been integrated in later releases since then? Is there an easy way to do it now?

Thanks.

amitaibu’s picture

Maybe this module can assist you - http://drupal.org/project/notifications

mitchell’s picture

Project: Workflow-ng » Rules
Version: 5.x-2.1 » 6.x-1.x-dev
Component: Miscellaneous » Documentation
Category: feature » support

This is easy to setup using Rules. Event: when comment is published, Action: send email to node author with body [comment:body] (something like that).

I'll leave this open, because this should really be turned into a documentation page.

For more complex Rules, you can use Flag. This is the main topic in this issue: #34496: [meta] Add Flag module to allow users to subscribe/unsubscribe without posting a comment.

Uersu’s picture

You say correctly that it is easy to send e-mail to the node author.

However, the problem comes when another user (e.g. the original node author) replies to the comment. In this case you may not want to send e-mail to the original node author, but instead to the guy that wrote the first comment.

This currently is not supported.

If I am not mistaken, then the comments table contains the following columns:

  • cid: unique comment id
  • pid: parent comment id, 0 if the comment is to a node, otherwise cid of the comment replied to
  • nid: node id to which comment applies
  • uid: uid of commenting user

Now, rules does provide the [comment:comment-cid], [comment:comment-nid] and [comment:comment-author-uid]. However, I seem to be missing the PID! Did I oversee something?

If this field is provided, then at least the simple case could be solved.

Uersu’s picture

Did anybody find a solution to this missing "parent comment id"?

betoaveiga’s picture

When you save a comment and you load it (using rules) you can obtain the pid.
Load this pid (parent comment) with _comment_load, and then you'll get a comment object with an uid field, which is the user that post the parent comment.
Load this user (user_load) and you'll get email you are looking for.
Hope that helps...

itangalo’s picture

Status: Active » Closed (works as designed)
StatusFileSize
new1.09 KB

As Uersu points out, the PID element of comments are not available as a token. This should, I think, be posted as an issue to the Token module -- the PID value is pretty useful to have.

While waiting for this in Token, the PID can be fetched using a line of PHP (as BetoAvegia also points out).

I've attached an example of how to fetch the relevant e-mail addresses when a new comment is posted. I'm just printing them out in a message to the user, so you should change the actions to something more appropriate if you use the feature.

The configuration is saved as a Feature -- se http://drupal.org/project/features -- but can also be installed as a regular module.

Good luck!
//Johan Falk, NodeOne, Sweden
PS: I'm not maintaining the Rules module, just helping with support questions. You are welcome to ask more questions at http://groups.drupal.org/rules

itangalo’s picture

Status: Closed (works as designed) » Closed (fixed)
Hunabku’s picture

If you're interested in a triggered rules and rules set solution for sending emails to both node authors and comment authors when a comment or reply is made, you might want to check out the following link:

http://drupal.org/node/724094#comment-3718596

shana598brush’s picture

Issue summary: View changes

Thank you for your kind words! Yes, what you're describing is possible with Workflow-ng. You can create a rule that triggers when a comment reply is posted, checks the original comment's author, and sends them an email notification—even if the replier isn't the node author. Just ensure the condition targets the comment entity and the action uses the original comment's user email. This setup keeps users engaged and informed. hhaexchange