3

I have some problem in triggering an action component.
I tryed to call it from the module function and from the devel/php page.

This is my component settings component settings

As you can see I have one node argument followed by 4 text arguments. And i'm trying to call it with this code

$node = node_load( 981 );
$return = rules_invoke_event('rules_send_mail', 
    $node, 
    'mymail@gmail.com', 
    '123', 
    'nome', 
    'sss' );
print_r( $return );

Nothing is printed on the page.. not an array or a FALSE.
The action simply send and email to client_mail.

Can someone help me to understand why is not working?

5

if its a rule action component than it should be called by

 rules_invoke_component('name', $other_parameters..);

while rules_invoke_event() is suppose to trigger an event on which you might have different rules to act on.

  • 6
    Just a quick note-- to invoke the component, you need to make sure to put rules_ in front of the machine name for the name. – Patrick Kenny Nov 26 '14 at 6:12
  • Mine is still failing to execute the action in rules_invoke_component because rules_get_cache('comp_' . $name) doesn't return a component object. Help??? – Wesley Musgrove Nov 23 '15 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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