Galvanized isn't a great choice in a potable water system, and plain black iron is even worse. There's dissolved oxygen in the water. Even galvanized is not plated after the threads are cut, so the ends are essentially black iron...iron rusts.
Use brass or copper, and it won't corrode like the iron stuff and probably outlast you, but at least the life of the POU water heater.
Black iron can work fine in a boiler system because it is a (or should be) sealed system...once all of the oxygen is bound up by rusting iron bits, the leftover water is pretty inert. Without oxygen, no rust can occur, so it can last. In a potable water system, the water is constantly supplying additional oxygen, so things will continually rust. It happens faster with hot water than cold.