Rails Mailer打印

时间:2012-07-03 05:26:20

标签: html ruby-on-rails ruby-on-rails-3 email actionmailer

我正在使用邮件程序向包含优惠券的用户发送HTML丰富的电子邮件。每封电子邮件最多可包含10张优惠券,但我想为每张优惠券添加一个打印链接,允许他们只打印一张..我怎么能最好地完成这个...

mail.html.erb(没有样式)

<body>
  <table width="100%" id="background" border="0" cellpadding="0" cellspacing="0">
    <tr><td align="center" valign="top">
      <table width="650" id="main" border="0" cellpadding="0" cellspacing="20">
        <tr>
          <td id="header" colspan="2">
            <a href="http://abc.com/"><img src="https://##.png" width="400" height="176" alt="Remindeals"></a>
            <h3>Hello <%= @user.name %>  this email is to remind you that you have  an occasion coming up in 2 weeks!</h3>
          </td>
        </tr>
        <tr>
          <td class="divider" colspan="2" bgcolor="#555555" height="2"></td>
        </tr>


        <% @deals.each do |d| %>
        <tr class="episode">
          <td>
            <a href="#"><img src="#.png" width="200" height="125" alt="#310 Getting Started with Rails"></a>
          </td>
          <td valign="top">
            <h2><%= d.store.name %></h2>
            <h2><%= d.title %></h2>
            <p><%= d.description %></p>
            <p>
              <a href="#">Print</a>

            </p>
          </td>
        </tr>
          <%end%>
      </table>
    </td></tr>
  </table>
</body>

0 个答案:

没有答案