rails 发邮件模板
2016-07-27 11:36
393 查看
rails发邮件模板不允许写css, 只能把css样式用style属性嵌套在html标签中
实例register_complete.html.erb中(邮件html.erb模板):
<div class="text-center main-body" style="color: #4B5259; background-image: url('http://bnbtrip.oss-cn-hangzhou.aliyuncs.com/assets/images/web/2016/02/bg2.jpg'); padding-bottom: 20px; background-repeat: no-repeat; background-size: cover; font-size: 14px;">
<h1 class="bnb-text-shadow" style="padding-top: 36px;color: #fff;">
<%= I18n.t("email.users.register_complete.subject") %>
</h1>
<h1 class="bnb-text-shadow">
<%= I18n.t("email.users.register_complete.subtitle") %>
</h1>
<div class="white-bg">
<div class="content-wrapper">
<h2 style="margin-bottom: 10px"><%= I18n.t "email.users.register_complete.hi", name: @user.full_name %></h2>
<h3 style="margin-top: 0;"><%= I18n.t "email.users.register_complete.one" %></h3>
<p>
<%= raw I18n.t("email.users.register_complete.p_one") %>
</p>
<p>
<%= raw I18n.t("email.users.register_complete.p_two") %>
</p>
</div>
</div>
</div>
实例register_complete.html.erb中(邮件html.erb模板):
<div class="text-center main-body" style="color: #4B5259; background-image: url('http://bnbtrip.oss-cn-hangzhou.aliyuncs.com/assets/images/web/2016/02/bg2.jpg'); padding-bottom: 20px; background-repeat: no-repeat; background-size: cover; font-size: 14px;">
<h1 class="bnb-text-shadow" style="padding-top: 36px;color: #fff;">
<%= I18n.t("email.users.register_complete.subject") %>
</h1>
<h1 class="bnb-text-shadow">
<%= I18n.t("email.users.register_complete.subtitle") %>
</h1>
<div class="white-bg">
<div class="content-wrapper">
<h2 style="margin-bottom: 10px"><%= I18n.t "email.users.register_complete.hi", name: @user.full_name %></h2>
<h3 style="margin-top: 0;"><%= I18n.t "email.users.register_complete.one" %></h3>
<p>
<%= raw I18n.t("email.users.register_complete.p_one") %>
</p>
<p>
<%= raw I18n.t("email.users.register_complete.p_two") %>
</p>
</div>
</div>
</div>
相关文章推荐
- Task类与async/await
- grails中阻止页面表单重复提交
- Hadoop多用户资源管理–Fair Scheduler介绍与配置
- 【leetcode Database】182. Duplicate Emails
- 服务器TIME_WAIT和CLOSE_WAIT详解和解决办法
- 2016 Multi-University Training Contest 3 1010 Rower Bo
- HDU 3264 Open-air shopping malls (计算两圆相交的面积 + 二分)
- POJ 1273-Drainage Ditches(最大流-Edmond-Karp算法/模板)
- Resource temporarily unavailable解决办法
- 7#tail
- grails导入excel
- 湘潭oj 1247 Pair-Pair
- (LeetCode)Contains Duplicate II --- 查找重复的元素升级版
- grails的插件
- http://blog.csdn.net/xinguan1267/article/details/38422149
- grails环境搭建
- publishing failed with multiple errors resource is out of sync with the file system--转
- 2016 Multi-University Training Contest 3 1011 Teacher Bo
- 2016 Multi-University Training Contest 3 1001 Sqrt Bo
- 2016 Multi-University Training Contest 3 1011 Teacher Bo