Hello!
After I commented out the previously mentioned code. I can save html templates as well and in the HTML tab the template is still there properly, but when the client receives the email as normal text.
The link does not work, the attached image is not displayed. Only the text is there.