Gmail 正在修剪 html 电子邮件内容。如何避免这个问题?
Gmail 在电子邮件中引入了修剪功能,以“提高可读性”。这给我带来了很多痛苦,因为我有一个电子邮件通知系统,我可以在其中向用户发送一些 html 电子邮件消息。电子邮件基本上如下所示:
divs and styling
Object alert in Project by User
tables and tr/td
User Action on Object in Project
/tables and tr/td
/divs and styling
link
footer
要将所有电子邮件分组到一个对话中,第一封电子邮件有主题,后续电子邮件有回复:主题。
活跃用户可以收到大量此类电子邮件,但由于“更好的可读性”功能,所有电子邮件内容(从第二封电子邮件开始)都会被抑制。
我正在寻求建议 - 也许我应该重新设计我的 html,或者 gmail 有一些反抑制代码,或者只是解决这个问题的 hack。
从用户角度描述的问题如下:http:// /www.google.com/support/forum/p/gmail/thread?tid=756b83fa60ca1df7&hl=zh-CN
Gmail introduced a trimming feature in emails for "better readability". This causes a lot of pain for me, as I have a notification system for email, where I send some html email messages to users. Basically email looks like this:
divs and styling
Object alert in Project by User
tables and tr/td
User Action on Object in Project
/tables and tr/td
/divs and styling
link
footer
To group all emails in one conversation, first email has subject, subsequent emails have Re: subject.
Active users can receive significant amounts of emails like this, but due to "better readability" feature, ALL of the email content (starting from second email) is suppressed.
I am looking for advice - maybe I should redesign my html, or gmail has some anti-suppression code, or just a hack to go around this issue.
Issue from users perspective is described here: http://www.google.com/support/forum/p/gmail/thread?tid=756b83fa60ca1df7&hl=en
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
PS:这有点无关,但我在寻找一种禁用内容修剪并同时保持对话视图的方法时偶然发现了这个问题。我没有找到任何东西,所以我为 Chrome 开发了一个小扩展程序 和 火狐。
PS: This is a bit unrelated, but I stumbled upon this question while looking for a way to disable the content trimming and keep the conversation view at the same time. I didn't find anything, so I developed a small extension for Chrome and Firefox.
事实证明,有一个非常简单的规则导致了这种行为:Gmail 一旦在邮件正文中看到发件人(
发件人:
)名称,就会立即剪辑该电子邮件,无论该邮件位于何处出现。解决方案:确保邮件正文中未使用电子邮件中的
发件人:
姓名(签名除外,签名可能会被剪掉!)。It turns out that there is a very simple rule which causes this behaviour: Gmail will clip the email as soon as it sees the sender (
From:
) name in the body of the message, regardless of where this appears.Solution: make sure that that the
From:
name in your email is not used in the message body (except in the signature, which will probably get clipped!).如果您不幸中招的话,这就是 Gmail 中的一个可怕的错误。
就我而言,它是在一个干净的线程中“修剪”整个消息。 在此处查看示例,请注意“修剪”的内容在屏幕截图中展开。
我最终解决了 Gmail 的错误,删除了您在该示例中看到的整个标头(“Awesome Home Swap”),包括其下方的边框。我没有真正尝试弄清楚到底是什么让 Gmail 将该标头混淆为“签名”(尽管我怀疑它可能是边框,使用 CSS 指令
border-bottom 实现:1px 点状灰色
来设置元素的样式)。
This is an awful bug in Gmail, if you're unlucky enough to get bitten by it.
In my case, it was "trimming" an entire message, in a clean thread. See an example here, noting that the "trimmed" content is expanded in the screen-shot.
I ultimately worked around Gmail's bug by removing the entire header you see in that example ("Awesome Home Swap"), including the border below it. I stopped short of actually trying to figure out what specifically was making Gmail confuse that header as a "signature" (though I suspect it could have been the border, implemented using CSS directive
border-bottom:1px dotted grey
to style the<td>
element).我刚刚找到了一个对我来说非常有效的解决方案。只需在整个电子邮件中创建一堆隐藏的独特图像,即可为电子邮件中实际上并不独特的部分提供独特性。我正在使用 React 构建电子邮件,因此我有这个
Unique
组件,我几乎在任何地方都使用它:我喜欢这个解决方案的一件事是它不会弄乱电子邮件预览文本如果您使用隐藏文本,则会发生这种情况。
I just found a solution that worked wonderfully for me. Simply create a bunch of hidden unique images throughout your emails to provide uniqueness to parts of the email that aren't actually unique. I'm building my emails with React so I have this
Unique
components that I'm using pretty much everywhere:One thing I like about this solution is that it doesn't mess up the email preview text that would otherwise happen if you're using hidden text.
在折叠部分之前添加双连字符 -- 。我能够将其包装在字体颜色与背景相匹配的字体中。为我工作...
Add a double hyphen -- before the collapsed part. I was able to wrap it in a with font color matching the background. Worked for me...
我查看了 Gmail 发送的电子邮件。添加以下代码 (spacer.gif)。
我想这就是解决方案。
I looked at the emails Gmail sent. Adds the following code (spacer.gif).
I guess this is the solution.