I am trying to create an Automatic Registration with rules. Basically when a new asset is created a rule will kick off and create a new registration node with custom PHP but the new node is not being created. I don't see any errors in the reports. Here is the code:
$node = new stdClass;
$node->type = 'asset_event';
$node->title = 'Automatic Registration';
$node->[field_first_name]['und'][0]['value'] = [site:current-user];
$node->[field_asset_event_type]['und'][0]['tid'] = 791;
$node->[field_asset_additional_informati]['und'][0]['value'] = 'Event created by automatic registration';
$node->[field_link_to_asset_id]['und'][0]['value'] = [node:field-link-to];
node_object_prepare($node);
node_save($node);
Thanks for any help.