As was true of his colleague, Zechariah, one of the major themes of the Prophecy of Chaggai was to encourage the People of Yehudah to continue the rebuilding of the Temple that had been destroyed by the Babylonians ca. 586 B.C.E.
His initial prophecy comes to him in the second year of the reign of "Daryavesh," Darius, King of Persia, who succeeded his father, "Achashverosh," or Ahasuerus. According to the Midrash (Vayikra Rabbah 13:4), this King was the son of Queen Esther.
The rebuilding of the Temple was begun by Zerubavel, the Jewish Governor, and by Yehoshua, the "Kohen Gadol," or High Priest, with the authorization of "Coresh," or Cyrus l, but the effort had been interrupted by the protests of the "Shomronim," the Samaritans, who didn't want to see the Jewish People rising again to prominence.
This Prophecy was delivered by Chaggai to the Governor, Zerubavel, and to the Priest, Yehoshua, to inspire them to continue their rebuilding efforts despite the protests, because HaShem now promises to help them.
HaShem says, (Chaggai 1:4)
The Prophecy has a positive effect.
Though their initial accomplishments are disappointing, HaShem encourages them, (Chaggai 2:3-4)
"Who among you that remain saw this House in its former glory? And now it must appear as nothing in your eyes!"
"But now, be strong, Zerubavel, says HaShem, and be strong Yehoshua ben Yehotzadak, High Priest, and be strong, all you People of the Land, says HaShem, and act, for I am with you, says the L-rd of Hosts."
HaShem promises that the future House will be splendid; (Chaggai 2:6-9)
" in a little while I will shake up all the nations and their precious things will come, and I will fill this House with glory The silver is Mine and the gold is Mine! The glory of this last House will be greater than that of the first, and in this place I will bring peace "
The reference above to "this last House," and more so, the reference to "bringing peace" strongly suggests a possible connection with the "Bayit Shlishi," the Third Temple, to be built by the Mashiach.
And at the end of the Sefer, HaShem makes a promise to Zerubavel, which has reference to the Second, and the Third Temples.
"On that day, says the L-rd of Hosts, I will take you, O Zerubavel son of Shealtiel, My servant, says HaShem, and I will make you as a signet; for I have chosen you, says the L-rd of Hosts."
Where the choice of Zerubavel refers not only to Zerubavel son of Shealtiel of that time, but to his descendant, the Mashiach, may he come soon and in our days.
According to the RAMBAM, Chaggai was a link in the Chain of "Mesorah," and received the Tradition of Torah from Baruch ben Neriah and his court.