That is good, just drop the random part and now the order# (aka: customer id or invoice no.) and date is more then enough to track the order as an RMA.

Now there is one final thing I believe the RMA needs to do.

Change the database status from complete (or whatever) to RMA Requested.

I think in header_php.php after sending mail, open database and change the status.