Praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
The funds collected for building an endowment, such as a mosque, take on the legal status of an endowment (waqf). This means that the money has exited the ownership of its donor, and no one has ownership rights over it. No one can freely dispose of it, and it remains dedicated to its intended purpose until the construction is completed. Therefore, those responsible for this project should make every effort to complete it.
It's important to note that the funds collected for building mosques should not come from Zakat (obligatory alms) money. These funds should solely consist of voluntary charities and donations. In addition, it is not permissible to use Zakat funds for constructing mosques or other purposes. This is because the Quran has specified eight categories as eligible recipients of Zakah. Allah the Almighty says {What means}: "Alms are for the poor and the needy, and those employed to administer the (funds); for those whose hearts have been (recently) reconciled (to Truth); for those in bondage and in debt; in the cause of God; and for the wayfarer: (thus is it) ordained by God, and God is full of knowledge and wisdom." {At-Tawbah, 60}.
Funds collected specifically for building a mosque should not be spent on other purposes, such as travel expenses, meals, or similar costs, unless the donor explicitly allows a certain amount of those funds to be used for such purposes and consents to it after being informed of the matter. In that case, you can travel to collect donations, provided that the spending is done in a reasonable and beneficial manner.
As for investing donations, it is necessary to inform the donors of this intention when collecting funds. This is because the donor's intention is to allocate the funds for their specified purpose, and they may not agree to delay or expose the funds to the risk of loss. The condition set by the donor is considered valid in Islamic law. Sheikh al-Islam Zakariya al-Ansari, may Allah have mercy on him, said: "If the donor stipulated something with the intention to achieve a specific goal, such as a condition that the property should not be rented, or that someone should be preferred or equalized, or designated for a purpose like a school or a mosque for a specific group {Like the Shafis}, then his condition is followed to fulfill his purpose, and his condition is applied." [Fath al-Wahhab, Vol. 1, Page 308].
The general rule is that donations should be spent according to the donor's intention and conditions because the donor is essentially the endower (waqif). Moreover, the condition set by the endower should be upheld, and the funds should not be spent except where the endower intended. It is stated in the commentary on "I'anat al-Talibin" (Vol.3, Page 200): "Therefore, they say that the condition of the endower is like the text of the Shariah."
The agent (wakil) is trustworthy, and the funds he receives from charity are a trust that he is obligated to safeguard and deliver. Failure to do so would be considered a breach of trust, and the person would bear the sin of betrayal if they use the funds for purposes other than what is specified or if they fall short in protecting them. They are responsible for that money and cannot absolve themselves of this responsibility except by delivering it. Allah, the Almighty, says: "O ye that believe! betray not the trust of God and the Apostle, nor misappropriate knowingly things entrusted to you." {Al-Anfal, 27}. And Allah the Almighty knows best.