I agree with @martinc. This is a nice simple way to accomplish this. Then you should be able to send them a follow-up email with the standard tracking link in it, with the affiliate code merge field merged into the url. If you plan to email them their link right after the action set, I would recommend atleast a 1 minute delay timer before the follow-up email, as the system will need a couple seconds to generate the referral record in the action set.