Don't be too hard on yourself. Triggers are tricky little things.
All things considered, I am glad you made it through.
Keep seeking honesty, love and transparency.
Perhaps MC at your church or with your pastor?
God is good and He believes in the sacrament of marriage. God certainly helped get me through the darkest days.