I’m not sure I understand the new API though. You define instance
methods but call class methods? Also, what’s that magic recipient
parameter we never pass in? Why not just define class methods? Eg:
class Notifier < ActionMailer::Base
delivers_from(“[email protected]”)
Just letting you know we have a new DSL for Action Mailer.
I think removing the magic #deliver_* and #create_* methods, and
returning an actual Mail object directly by an existing method makes a
lot of sense.
On the other hand, I think replacing methods like #body, #subject,
etc. with a hash is a missed idea, it’s harder to write and read, and
less clear to grasp, especially when you notice that ActiveRecord API
changes in exactly the opposite direction (from :conditions =>
conditions to #where(conditions), etc.).
Are there any more improvements planned on this or is that the final
version?
On the other hand, I think replacing methods like #body, #subject,
etc. with a hash is a missed idea, it’s harder to write and read, and
less clear to grasp, especially when you notice that ActiveRecord API
changes in exactly the opposite direction (from :conditions =>
conditions to #where(conditions), etc.).
Are there any more improvements planned on this or is that the final
version?
You don’t have to pass body as a hash, you pass the body in through
the template in 99% of the cases.
Think of the mail method as being analogous to the respond_to method
in Action Controller.
There are more changes coming, not big, but intelligent ones. Watch
this space