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>