2

How to notify an author of a node, when her content is commented by another user on Drupal 7?

0

1 Answer 1

5

Use Rules module. Create the following Rule:

  1. Event: after saving a new comment. You will probably want to restrict this by content type as well.
  2. 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 and comment:author:uid so that the user does not receive emails for his own comments.

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], [...]
4
  • 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.
    – Castor
    Commented Aug 5, 2016 at 10:20
  • Answer updated. Hope this helps. Commented Aug 5, 2016 at 10:33
  • 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?
    – Castor
    Commented 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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