سؤال

I recently came across sending emails via Rails. After watching railcast, it seems that you can write up a template when using Action Mailer. I really liked this feature for my purpose. I also came across Pony, which seems really easy to use.

I was wondering if I can use templates for sending emails via Pony, unless Pony is meant for express non-templated emails.

هل كانت مفيدة؟

المحلول

In my research, Pony seems to be promoted as a non-template based tool, making it "simpler" to use. The home page for the utility does not mention templates at all: https://github.com/benprew/pony

نصائح أخرى

You can easily access the view framework by explicitly rendering a template:

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)
)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top