What you are using seems OK, for the email when they register that is template that should be in your skins folder and its called email_registrationaccepted.tpl,
The variables to use in there are,
//Firstname Lastname
<?php echo $pilot->firstname.' '.$pilot->lastname ?>
//Firstname Lastname Pilot ID
<?php echo $pilot->firstname.' '.$pilot->lastname ?> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?>
This is what i use OK.
Let me know how you get on.