I've been trying to get rules to send an email to the node author when a comment is added to their page but I can't seem to figure out how to do it.

I tried creating a rule that when a comment is saved that I first fetch

comment:node:author:uid

and then send an email to the
entity-fetched:author:mail

but the email doesn't send.

Any suggestions?

Comments

dasjo’s picture

Component: Rules Core » Rules Engine
ptnguyen’s picture

this is what the debug says

Rules evaluation log
0 ms Reacting on event After saving a new comment.
10.129 ms Evaluating rule new comment.
10.958 ms The condition node_is_of_type evaluated to TRUE
10.97 ms AND evaluated to TRUE.
12.803 ms Evaluating the action entity_fetch.
14.117 ms Unable to load node with id "42"
14.133 ms Unable to execute action entity_fetch.
14.321 ms Unable to get variable entity_fetched, it is not defined.
14.329 ms Unable to execute action mail.
14.369 ms Evaluating rule newcomment.
14.379 ms AND evaluated to TRUE.
14.791 ms Evaluating the action entity_query.
16.463 ms Added the provided variable email of type list
25.279 ms Missing data values.
25.292 ms Unable to execute action mail.
25.351 ms Finished reacting on event After saving a new comment.

ptnguyen’s picture

i also come up with this error

Warning: array_values() [function.array-values]: The argument should be an array in rules_action_entity_query() (line 98 of /sites/all/modules/rules/modules/data.eval.inc).

dasjo’s picture

you see that it fails due to
14.117 ms Unable to load node with id "42"

try to fix your rule, or post an export of the rule in order to get further help

tr’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes
Status: Active » Closed (outdated)