What is the ruling on someone who makes an intention to fast and sleeps and wakes up in the morning having realised he has had a wet dream. This person unfortunately had a wet dream before the time of fajr prayer and didn't get up to do ghusul and also didn't pray fajr.

Considering this is a recommendated fast, will his fast be valid or invalid.

Yes the fast is valid.