我最近遇到了通过Rails发送电子邮件的问题。看完railcast后,似乎你可以在使用Action Mailer时编写一个模板。我真的很喜欢这个功能。我还遇到了Pony,它看起来真的很容易使用。
我想知道我是否可以使用模板通过Pony发送电子邮件,除非Pony是用于快速非模板电子邮件。
发布于 2012-09-30 01:07:58
在我的研究中,Pony似乎被提升为一个非基于模板的工具,使其使用起来“更简单”。该实用程序的主页根本没有提到模板:https://github.com/benprew/pony
发布于 2013-10-14 01:54:19
您可以通过显式呈现模板来轻松访问视图框架:
Pony.mail(
:to => 'somewhere@example.com',
:from => 'sender@other.example.com',
:subject => 'an example',
:body => render_to_string("path/to/_partial", :locals => {foo: @foo}, :layout => false)
)https://stackoverflow.com/questions/10475152
复制相似问题