I never encourage a letter to the judge. The judge won't read it.
Have your friend retain counsel.
BTW, the text message did not say she was evicted, it said "pack your stuff"
The text message said she is being evicted, not that she was evicted.
The judge will most likely not read a letter. Your friend should have paid the rent. If there is no Summons and Complaint for eviction filed and served, then the process has not yet been started. Texts don't count. Have her pay the rent if possible and stop doing what she should be doing for herself.