All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The saying of the husband to his wife that if she does a particular thing he will divorce her, then this does not lead to divorce even if she does what he conditioned divorce on, because this is just a promise from him to divorce her and this does not lead to divorce unless he initiates it; for more benefit, please refer to Fatwa 90318.
As regards his saying to her if she speaks to some relatives she will be divorced, then if he intended to divorce her just if the speaking takes place with them whether by her speaking to them or them speaking to her, then divorce takes place. However, if he just intended to divorce her in case she speaks to them, then divorce does not take place by them speaking to her. To conclude, this depends on his intention.
As regards the wife knowing the condition or not knowing it, then this is of no effect according to the view of the majority of the scholars . What should be taken into account is that the husband conditions her divorce on the occurrence of a particular thing, and then the thing on which he conditioned divorce takes place.
Furthermore, the commitment of the husband to his relatives not to talk to his wife, then if he did not condition divorce if he talks to her, then this does not lead to divorce if he contravenes this commitment and talks to her. However, if this commitment was conditioned on divorcing her if he informs her, and it happens that he informs her, then divorce takes place by the occurrence of the thing upon which he conditioned divorce. Besides, anger does not prevent divorce from taking place if the person is conscious about what he says. For more benefit, please refer to Fatwa 81843.
Nonetheless, if this commitment is with Allaah, then it is an oath which necessitates expiation for breaking his oath. For more benefit, please refer to Fatwa 102811.
Finally, it should be noted that it is necessary to avoid marital disputes and to be keen on solving them with wisdom if they take place, and to avoid using the words of divorce as a solution.
Allaah Knows best.