![Thunderbird logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2024-02-12-07-36-53-599028_1.png)
html templates not saving correctly
I'm using Thunderbird on Windows 10, and it's up to date.
I made a html template for body of the email. Let's say the template is saved in Notepad. And it's all inlined.
When I copy/paste the html code from the Notepad, and insert it as HTML in email and send the email, everything appears as intended. So I saved it as a template in Thunderbird. When I send an email from the Thunderbird template, the email looks not as intended. (More specifically, no "dark mode" logo)
Is there any explanation why the two outcomes look different?
When I looked at the source from "View source", I found some differences (obviously):
- 1. From the Notepad code, everything is organized perfectly (<style></style> content .
- 2. From the email that appears intended, things are rearranged a bit (<style></style> content )
- 3. From the email that looks wrong (the one sent from Thunderbird template folder), it's basically in the structure as in #2, except style is at the very end of the body ( content <style></style>), and apparently it stripped off all "@media (prefers-color-scheme: dark)" part, which is the reason it messes up the dark mode logo, i presume.
I opened the template again and checked the inserted HTML, and as I expected, it didn't save the "@media" part. Clearly, Thunderbird is capable of sending an email with "@media" in the style tag. Why wouldn't it save it in the template?
Сви одговори (7)
Instead of entering the html in Notepad and copying into TB, have you tried composing the message directly with the TB message composer and saving it as a template? Creating signatures or templates in other applications often leads to issues with TB, even if the html is perfectly valid.
So I copy and type out the entire code, character by character instead? I don't see how it'll help, but I'll try it. Thanks for suggestion.
Edit: I think i misunderstood. And here's what I did:
Made the html code in DW. Open TB, Click "Write", click the body part of the email, click "Insert" on the top menu, click "HTML", and copied the code from DW and pasted it into the new opened Window, confirm "Insert", click "Save", click "As Template".
Измењено
You don't have to type it out - just create the template using the menus in the html message composer, to ensure you're not adding any non-compliant html.
oh I see. Yeah but that's exactly what I did. Any other things I can try?
By using the html message composer, I don't mean that you should copy the html from a different app like DW into the Insert window. Just use commands like Insert/Image... or Insert/Table... and use the Formatting Toolbar to change fonts etc.
Oh I see. But how do I insert something like "@media (prefers-color-scheme: dark)" or "cell spacing" or paragraph styles that way? I'm building a template that can be used in other occasions, not just one-time email.
I can't say which html code won't work in TB, but if you can't add it with the message composer, there's a good chance it's not compatible. Other than that, I think you'll have to experiment. There is an add-on that might help, compared to entering through the Insert/HTML window.
See also https://addons.thunderbird.net/en-us/thunderbird/addon/smarttemplate4/