Get your self a bag of Simpson straps at Home Depot...
Also on the rear of the structure tie in a 2 X 4 from the inside corner at top
than angle to center at bottom, from both sides.
I know it sucks having things like this happen..
Hang-in there and forge ahead !