The vow mentioned here is called a conditional vow. The Prophet (blessings and peace of Allah be upon him) forbade making such vows and said that it only gets something out of the miser. The reason why he is called a miser is that the one who makes this vow is not doing this charitable act – namely offering a sacrifice, in your case – until after Allah has fulfilled his request.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
The basic principle is that making vows is makrooh (disliked), because it is proven that the Prophet (blessings and peace of Allah be upon him) disallowed making vows and said: “It does not bring any good; it only gets something out of the miser.”
End quote. Majmoo‘ al-Fataawa (35/354).
This is different from a vow to do an act of obedience or worship, which is something praiseworthy, in which the one who makes the vow pledges to do an act of worship or obedience without stating any condition of obtaining some worldly benefit.
Both kinds of vows must be fulfilled.
For details on different types of vows and the rulings thereon, please see the answer to question no. 2587.
See the answer to question no. 119562 for a highlight on the prohibition of making vows for one who believes that Allah, may He be exalted, will fulfil the request of the one who makes the vow just because he made a vow!
It is not permissible for the one who made the vow to eat any of the meat from the animal which is sacrificed in fulfilment of his vow, unless he intended that he would eat from it or stipulated that he would do so. Therefore if you did not stipulate such a condition, it is not permissible for you – or your family – to eat from the meat of the two sheep you slaughter.
It says in Fataawa al-Lajnah ad-Daa’imah (23/392):
If a person makes a vow which involves feeding people, then the basic principle is that the one who makes the vow should not eat from the food he provides in fulfilment thereof, unless he stipulated or intended that he would eat from that food, in which case it is permissible for him to eat it in accordance with what he stipulated or intended. End quote.
See also the answer to question no. 82667
If the one who made the view stipulated who would be the recipients of his vow, then he must adhere to what he stipulated, such as if he vowed to give it to friends, relatives, neighbours, and so on. But if he made his vow in general terms and did not stipulate anyone in particular, then he may give what he vowed to the poor and needy, because they are the people to whom charity is to be given, and are the people to whom food in fulfilment of a general vow is to be given, because they are the recipients of charity in general terms, as they are poor and needy. Undoubtedly the poor are more deserving of it than others.
Based on that, if the fasting people who come to the mosque for iftaar are among the poor and needy, then there is nothing wrong with you giving the two sheep to someone who will cook them to feed those people. But if that is not the case, then you should not do that; rather you should distribute the meat raw to the poor and needy. This may be better for many of them, so that the entire family may eat from it.
You should also strive to ensure that the two sheep are meet the quality and description required for udhiyah sacrifice, so that you will have fulfilled your vow properly.
The scholars of the Standing Committee said, in response to a similar question, something which sums up what we have said to you:
You have to fulfil your vow that you mentioned, by sacrificing the two sheep that you vowed to sacrifice, and distribute the meat to the poor and needy. It is essential that the two sheep meet the quality and description required for udhiyah sacrifice, which is a sheep one year or older, or a goat older than one year. May Allah help you to fulfil your vow and make things easy for you. And we advise you not to make vows in the future, because the Prophet (blessings and peace of Allah be upon him) disallowed making vows and said: “It does not bring any good; it only gets something out of the miser.” (Agreed upon).
Shaykh ‘Abd al-‘Azeez ibn Baaz, Shaykh Saalih al-Fawzaan, Shaykh ‘Abd al-‘Azeez Aal ash-Shaykh, Shaykh Bakr Abu Zayd
Fataawa al-Lajnah ad-Daa’imah (23/332)
And Allah knows best.