I'm facing an issue which is quite boring since the result displayed into Devel's PHP executer differs from the results of the Custom PHP code. What I want to do is sending private messages (thanks to privatemsg module) to certain users that I can't select with privatemsg Rules integration.
To send a new private_msg, we have to use the function "
privatemsg_new_thread($recipients, $subject, $body)".
So I have to write a custom PHP code which is (I made it very simple) ; this one works in Devel but not in Rules.
$recipients = array(user_load(1)); $subject = 'hello'; $body = 'ok'; privatemsg_new_thread($recipients, $subject, $body);
When i write this ; it works with both modules
privatemsg_new_thread(array(user_load(1)), 'hello', 'ok');
Is there a problem with loading variables or sth ? And i don't have any error log...
Any help would be highly appreciated !
Thanks in advance