I am a Rails developer recently trying out merb and found
Merb::MailController very slick. I really like idea that I could use
before/after filters and layouts when sending mail.

However, I cannot send email from offline scripts, because send_mail
needs to be called inside a Controller.

After digging around the source and some experiments, I finally found
a way to send email from a offline script:

#AccountMailer is a subclass of MailController
AccountMailer.new({:user => User.first},
Merb::AbstractController.new).dispatch_and_deliver(:reminder,
{ :from => "[EMAIL PROTECTED]",:to => "[EMAIL PROTECTED]",:subject =>
"offline!!" })

Hope this is useful for somebody else.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to