“The Shulhan Arukh, the great work that has become the fundamental halakhic text for all of Jewry, was written by Rabbi Joseph Caro, a sage whose authority rested not only on his very broad learning but also on his many-sidedness and mystic insight.
He wrote other books of halakhic procedure and law, exegesis on Torah and the like, and in addition he wrote a treatise called Maggid M’esharim, which was certainly a kabbalistic work and showed him to be a man who had mystical experiences and visions.
Those of his generation who heard about his revelations were inclined to say that it was the voice of the Mishnah speaking from his mouth.
To this day, the inspired orders of prayers we follow on the all-night tikkun of Shavout are those of Rabbi Joseph Caro.
And one of his closest disciples wrote the famous Shabbat song ‘Lechah Dodi,’ now accepted in all circles of Jewish worship, which is obviously a kabbalistic poem.
So we see that the greatest of the halakhic legal authorities was very much immersed in the mystical world of Kabbalah.”
From On Being Free, p. 190, by Rabbi Adin Steinssaltz