The individual is supposed to contribute to the community and vice versa, but what, why and wherefore? What is the essence of the relationship between the individual and her/his community?
Humans are teleological, i.e. they can think ahead with a goal in mind. Individuals form groups with common goals and call this setup a community. Clearly, all individuals must contribute to the achievement of common goals, otherwise they exclude themselves from the community. But as generations come and go, community membership becomes non-elective. It happens to one, as opposed to being consciously chosen by one. No-one shares each and every goal of the various smaller and larger communities (s)he happens to belong to. Which does not invalidate or delegitimise communities, but explains why there is so much confusion about this tangled relationship.
In principle, the individual could choose what communities (s)he wished to belong to. But in practice, this would lead to inconsistency. For instance, an individual allegedly could choose to not be part of a national community, but the same individual could not choose to not be part of a tax community, which is pretty much the same community. If such contradictions were allowed, this would result in an ad hoc concept of the individual - community relationship. It would amount to suggesting that a person can choose membership of a certain kind (national), but cannot choose membership of another kind (taxation). The difference between the two kinds of membership is unclear, it appears to be more of a matter of personal taste. This would introduce a double standard: the same person would be free regarding Membership A but not free regarding Membership B. The idea of a double standard can be challenged by using the example of a club. No-one is forced to be a member of a club. But in what ways is a national community a club, whereas a tax community not a club? Doesn't the national community set up the government organisation that collects taxes? If so, the distinction between the two communities is unclear. It would be hard to argue that membership in one is optional, whereas membership in the other is mandatory.
We could use war as a counter-example: a pacifist may choose to not go to war for her/his community. But in practice, this does not exempt the pacifist from punishment for breaking the rules of her/his community. Progeny may decide in the pacifist's favour, but this won't save her/him from whatever consequence is applicable at the time. On the one hand, this is a relatively rare sub-case of mandatory community membership, and on the other, it doesn't actually alter the contemporary relationship. This demonstrates that membership in one or more unwanted communities is mandatory.
So, can an individual who prefers not to be a member of a moral community be forced to be a member nonetheless? That appears to be the case. It clearly is the case with people who object to community membership in common law cases. A murderer cannot say (s)he does not wish to be a member of her/his moral community and thus escape the consequences. It would be all too easy to argue that though (s)he was born with a specific nationality, (s)he relinquished it just before committing the crime, so (s)he is under no court's authority and must be released. This argument doesn't convince any judge anywhere in the world, which is second-line confirmation that moral membership is considered legally binding.
Does mandatory moral membership apply to marital fidelity, too? It does, and entails legal consequences to the extent legal consequences exist. If there are no legal consequences, membership is still mandatory, though it doesn't materialise in a court sentence. That doesn't mean the affected person is also required to agree - (s)he is not required to agree with a court sentence either, but either it doesn't alter the sentence, or it can be regarded as an aggravating circumstance and make the verdict even worse.
Individuals are required to contribute to the achievement of community goals, and the community is required to promote the individual's happiness and flourishment. The community does so primarily by ensuring the background in which this can happen. Individual happiness and flourishment require community structures, in the absence of which individuals will wilt, rather than flourish. In other words, the community must enable happiness and flourishment.
In conclusion, the individual belongs to a moral community on a mandatory basis, is required to contribute to the achievement of the common goals, and in return, the community must promote the individual's happiness and flourishment.