To help pull the water from the carpeting and padding...use a DEHUMIDIFIER...it will work a lot better than a heater...and do it soon to help prevent the development of mold.
Anytime power is disconnected, the sunroof or pano roof needs to be reinitialized. I don't remember seeing model year info from the OP...so we don't know if its a pano or regular sunroof.
I'll go out on a limb and assume that its the pano sunroof...see reinitializing info below: