我的邮件方法如下(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”的邮件,如果我在我的邮件程序方法中使用推荐的代码行我可以做到,但是它的对齐,内容都不合适,我该如何解决这个问题,等待您的宝贵信息
答案 0 :(得分:0)
希望您的模板位于views/customer_mailer/X.html.erb