无法在rails 4.0.8中将邮件内容呈现为html / text格式

时间:2015-02-06 06:05:35

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

我的邮件方法如下(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格式发送内容为“message”的邮件,如果我在我的邮件程序方法中使用推荐的代码行我可以做到,但是它的对齐,内容都不合适,我该如何解决这个问题,等待您的宝贵信息

1 个答案:

答案 0 :(得分:0)

希望您的模板位于views/customer_mailer/X.html.erb