If a player is in an alliance, and owns a castled city that is within 20 squares of an active shrine, there is a chance that this city can be blessed by the shrine. Once a city gets blessed, the player and his/her alliance-mates have 72 hours to send wood and stone via "Temple delivery" trade, to the blessed city. To build a level 1 Temple, requires 10 million each of dedicated wood and stone. Once this amount of wood and stone has been sent, and arrived, at the blessed city, the city owner will have the option to build a Temple.
Don't worry, you do not need to have 10 million resource storage capacity in your city, to store these large amounts of wood and stone! Once the player who is sending you resources has specified the trade is a "Temple delivery", the resources will get stored seperately from your regular resources, as "dedicated Temples resources". There is no limit to how many dedicated Temple resources you city can store.
Once a city has a Temple built inside it, it can be blessed again by the same shrine (it can no longer be blessed by different shrines however). If a Temple city gets blessed again, the player has the option to upgrade it. Temple upgrades will cost successively more dedicated Temple resources, which the player and their alliance will need to supply. For more information on how many dedicated Temple resources a Temple needs to build and upgrade, see the Buildings page.