2015-02-06 38 views
2

如下(customer_mailer.rb)無法呈現郵件內容爲HTML /文本格式在軌4.0.8

 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格式發送包含內容「消息」的郵件,如果我在我的郵件程序方法中使用受稱讚的代碼行,我可以這樣做,但它的對齊方式,內容都不正確,我該如何解決這個問題,等待您的寶貴信息

回答

0

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

+0

是的你是對的 – 2015-02-06 18:06:32