recipients as $recipient) { if ($recipient->type == 'user') { rules_invoke_event('privatemsg_insert', $message, $recipient); } } }