Effect of solvent and temperature on proton transfer reactions of excited molecules