我发送的是这样的:
Pony.mail :to => 'me@mine.com.au',
:from => 'me@mine.com.au',
:subject => 'Howdy, Partna!',
:body => erb(:email)
它工作得非常好,除了纯文本电子邮件到达了布局html
如何告诉它不使用布局,只使用email.erb模板?
答案 0 :(得分:1)
Pony.mail :to => 'me@mine.com.au',
:from => 'me@mine.com.au',
:subject => 'Howdy, Partna!',
:body => erb(:email, layout: false)
答案 1 :(得分:0)
喜欢这个
set :erb, :layout => false
body = erb (:_emailhtml )
Pony.mail :to => 'will@kindleman.com.au',
:from => 'will@kindleman.com.au',
:subject => 'Howdy, Partna!',
:html_body => body
Pony / ruby / sinatra不喜欢将erb(:_emailhtml)直接放入选项哈希,并且需要在erb方法之前设置布局文件。
耶。