我这样发送:
Pony.mail :to => 'me@mine.com.au',
:from => 'me@mine.com.au',
:subject => 'Howdy, Partna!',
:body => erb(:email)
它工作得非常好,除了纯文本电子邮件到达时充满了布局 html
我如何告诉它不使用布局,只使用 email.erb 模板?
Pony.mail :to => 'me@mine.com.au',
:from => 'me@mine.com.au',
:subject => 'Howdy, Partna!',
:body => erb(:email, layout: false)
像这样
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) 直接放入 options 哈希中,并且需要在 erb 方法之前设置布局文件。
耶。