【问题标题】:Not able to render mail content to html/text format in rails 4.0.8无法在 rails 4.0.8 中将邮件内容呈现为 html/text 格式
【发布时间】:2015-02-06 06:05:35
【问题描述】:

下面给出的我的邮件方法(customer_mailer.rb)

      def X customer, message, cust_mail, email_subject
        subject = email_subject
        mail_ids=cust_mail.to_s.split(",")
        mail :subject => subject || "Your Invoice", :to => mail_ids, :body => message
#mail :subject => subject || "Your Invoice", :to => mail_ids, :body => ERB.new(message).result(binding)

      end

我的 html 视图 (X.html.erb)

<html>
<body bgcolor="#D6A1A1">

<table width="100%" bgcolor="#D6A1A1" cellpadding="10" cellspacing="0">

</table>

</body>
</html>

我需要通过html格式发送带有“消息”内容的邮件,如果我在我的邮件方法中使用推荐的代码行我可以做到,但是它的对齐,内容都不正确,我该如何解决这个问题,等待您的宝贵信息

【问题讨论】:

    标签: html ruby-on-rails ruby-on-rails-3 ruby-on-rails-4


    【解决方案1】:

    希望你的模板在views/customer_mailer/X.html.erb

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-22
      • 2016-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多