Men cheat because they don’t get their needs met in their marriage. It’s not because she’s more beautiful than you are or more charming than you are. It’s because he wanted to feel valued and she made him feel that way. And…. the two of you were fighting. That’s the reason he did what he did. I don’t believe, from what you wrote, that it went beyond the flirtatious texting — but I’m not there. However, the key is not the relationship he has with her — it’s the one he has with you. Focus on the real problem, what’s going on between the two of you, not the distraction (his flirting with someone else).
I hope that helps.