我正在尝试创建一个应用程序,该应用程序将发送样式繁重的电子邮件,并要求客户端工作(Google Gmail 除外)。我研究了这个问题,看起来 Gmail 删除了外部文件中的 CSS 或嵌套在“style”标签中的 CSS。是否存在将样式从外部文件移动到内联的简单方法?
需要的东西:
<style>
.wide { width: 100px; }
.cell { display: block; }
</style>
<span class="wide cell">Sample</span>
并将其转换为:
<div class="wide cell" style="width: 100px; display: block;">Sample</div>
Thanks!
以下是您可以查看的一些宝石:
-
预邮者 http://github.com/alexdunae/premailer or 预邮器-rails https://github.com/fphilipe/premailer-rails用于导轨
- 邮件样式 https://github.com/purify/mail_style
-
预邮递加 https://github.com/mikedamage/premailer-plus(上述版本的fork)
- 很棒的电子邮件 https://github.com/imedo/awesome_email
- roadie https://github.com/Mange/roadie
我在写这个答案时还没有获胜者,但是预邮者似乎是最新的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)