Almost every jurisdiction has explicit anti-retaliation laws that protect tenants from eviction when they report housing code violations or contact authorities about habitability issues like broken heat. Your landlord can't legally evict you for making complaints, filing with a tenant rights board, or even withholding rent (in jurisdictions where that's allowed). The burden is on them to prove the eviction is for a legitimate reason unrelated to your complaints - and with three documented attempts to report the heating issue, you've got solid evidence of the timeline.
That said, the specifics depend on where you live. Some places have stricter protections than others, and the process for filing a complaint varies. Your best move is to contact your local tenant rights organization or housing authority to understand exactly what protections apply in your area and what your options are. Most of them can tell you whether you can legally withhold rent, repair-and-deduct the costs yourself, or if you need to go through the formal complaint process first. Keep all your communications with your landlord (those emails and texts are gold) and document the dates and any responses or lack thereof.
Get this on the record sooner rather than later. A formal complaint to the housing department or tenant board actually strengthens your position because it creates an official timestamp showing you tried to resolve it properly. The retaliation protection kicks in once you've made that complaint, so your landlord would have an even harder time justifying an eviction after that point.