搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

html templates not saving correctly

  • 7 个回答
  • 1 人有此问题
  • 3 次查看
  • 最后回复者为 sfhowes

more options

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. 1. From the Notepad code, everything is organized perfectly (<style></style> content .
  1. 2. From the email that appears intended, things are rearranged a bit (<style></style> content )
  1. 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?

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 (<html><head><style></style></head><body> content </body></html>. #2. From the email that appears intended, things are rearranged a bit (<html><head></head><body><style></style> content </body></html>) #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 (<html><head></head><body> content <style></style></body></html>), 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)

more options

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.

more options

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".

由d.o.u.b.l.e.h于修改

more options

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.

more options

oh I see. Yeah but that's exactly what I did. Any other things I can try?

more options

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.

more options

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.

more options

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/