Just provide it through the roots. Foliar sprays of nutrients are a form of self-fellation. It's fine as a reaction to a problem and a way to immediately provide the nutes to a local area on the plant, but doing so regularly will just elevate risk of WPM and slowly clog up stomata... Stomata is how CO2 etc, and that is WAY WAY moer important.
folair sprays should be significantly reduced concentration compared to properly feeding through the roots. in a soilless/hydro context where you supply 100% of nutrient needs through fertigation, it's around 75ppm... you may want 10ppm? not 100% sure because i don't engage in it andnever had to add Mg this way. I simply provide enough in my fertigation.
Not all nutrient molecules can traverse the stomata and enter the plant this way. Mg can. This is reference material you can google.
also, you can save a ton and not buy branded epsom salt for horticulture (magnesium sulfate). Simply by the generic foodgrade, nothing-added epsom salt at your local store. Walmart equate brand is 8lbs for like 5-7 dollars? Don't overpay for magnesium sulfate. Like generic Rx, it is molecularly atom-for-atom the exact same thing. 9.8% Mg and 12.9% S like clockwork.