简体   繁体   中英

Should i use HTML comments in my email templates?

Trying to see if there are any negatives to adding HTML comments to my html emails?

Any feedback is great.

Thanks

I don't think so. I've made several professional e-mail templates for Outlook that contained a little notice in the comments. I've never had any problems with that. I even had fun to see that I could find an e-mail sent by a customer, because Google had indexed it, including the comment. :D

It does increase the size of the e-mail a little, so use with care.

没有,除非注释的数量太多,否则它们将影响浏览器/电子邮件客户端对DOM的解析并导致网络流量拥塞。

Unless you're revealing secrets of your network, I don't see anything wrong with it. Allot of systems have comments to highlight template system areas.

One thing I ran into recently was that comments in email HTML should be avoided when nesting around MSO code (used for visibility/layout issues with MS products). I had an image refuse to load in Outlook.com because the MSO text was located in-between two of my comments. The syntax seemed to confuse Outlook in particular. Drove me bats. Then I took the comments out, wham -- the image displayed, problem solved.

Two drawbacks :

  1. It makes the e-mail bigger. You should consider it if time or bandwidth is an issue, say if you are going to send thousands of e-mails.
  2. It means your e-mail is in HTML, which is to be avoided if possible at all.

It should be fine, but I would be careful with any sort of emails with html content. Html in email is particularly tricky because the clients (aol, outlook, gmail, thunderbird, etc) can display the results quite differently. A quick google search brought me to emailonacid.com, an email testing/deliverability tool which might be useful if you want to be thorough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM