Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 ActionMailer 涉及生成报告并将其存储到 HTML 文件中并将其作为 HTML 附件发送。我想给它一些样式,所以我添加了每次生成报告时都会写入 HTML 文件的内联样式。
但是样式并没有反映在附件中。有趣的是,在我的机器上本地打开时生成的报告反映了样式。我看到了附件的 HTML 源代码,并且缺少内联 css 样式。我完全不知道它为什么会发生。单挑将不胜感激!
ActionMailer 有一些很奇怪的操作方式。CSS 是渲染模板时真正会遇到的事情之一。看看这个解决方案:
http://devblog.imedo.de/2008/08/05/rails-actionmailer-with-html-layouts-inline-css-and-entity-substitution/