Add variable to rule before execution I'm looking for a way to alter the variables before a rule is executed. Specifically, I'm trying to add a list of users who should be notified of a new comment so that I can create a loop and send an email to each.

I have implemented hook_rules_event_info_alter as follows:

function mymodule_rules_event_info_alter(&amp;$events)
{
    $events['comment_insert']['variables']['affected_users'] = array('type' =&gt; 'list&lt;user&gt;', 'label' =&gt; 'Anyone that should be notified about a new comment.');
}


However, I am at a loss as to which hook needs to be implemented in order to fill in this variable before it is used. (On my site the default will be the node author, however there are some nodes where several users should be notified).
The implementation should be placed into the file MODULENAME.rules.inc, which gets automatically included when the hook is invoked.