0

我这样发送:

Pony.mail :to => 'me@mine.com.au',
        :from => 'me@mine.com.au',
        :subject => 'Howdy, Partna!',
        :body => erb(:email)

它工作得非常好,除了纯文本电子邮件到达时充满了布局 html

我如何告诉它不使用布局,只使用 email.erb 模板?

4

2 回答 2

1
Pony.mail :to => 'me@mine.com.au',
    :from => 'me@mine.com.au',
    :subject => 'Howdy, Partna!',
    :body => erb(:email, layout: false)
于 2012-12-28T15:24:53.027 回答
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) 直接放入 options 哈希中,并且需要在 erb 方法之前设置布局文件。

耶。

于 2012-10-03T09:46:28.223 回答