How to notify an author of a node, when her content is commented by another user on Drupal 7?
1 Answer
Use Rules module. Create the following Rule:
- Event: after saving a new comment. You will probably want to restrict this by content type as well.
- Add action: send mail. Arguments:
- To: switch to data selection and choose
comment:node:author:mail
- Subject: whatever you want, for example "A comment has been posted to your blog post"
- Add the message
- Condition: NOT
comment:node:author:uid
andcomment:author:uid
so that the user does not receive emails for his own comments.
- To: switch to data selection and choose
Here's how to insert the name of the node author:
Formatted username:
Dear [comment:node:author:name], [...]
Specific field (e.g. if you have first and last name fields and you want to use only first name):
Dear [comment:node:author:field-first-name], [...]
-
Wow that was simple and works like a charm. One question left: How to insert the name of the node author in the e-mail? Like: Dear X, your entry has been commented.– CastorCommented Aug 5, 2016 at 10:20
-
-
It does indeed. Much apreciated. I go with this solution. However It appeares that if I comment on my own post I get an e-mail nontheless. So I added the folowing condition: NOT Data comparison Parameter: Data to compare: [comment:node:author:uid], Data value: [comment:author:uid] Do you think this is the right way to do that?– CastorCommented Aug 5, 2016 at 11:05
-
Welcome! Yes, that's the way to do it. I'll update my answer shortly. Commented Aug 5, 2016 at 11:09