Rails Mikel Mail Gem How to use Views

Posted by Victor Martins on Stack Overflow See other posts from Stack Overflow or by Victor Martins
Published on 2010-04-24T22:17:34Z Indexed on 2010/04/24 22:23 UTC
Read the original article Hit count: 293

Filed under:
|
|

I'm trying to use mikel gem mail on my 2.3.5 Rails App

http://github.com/mikel/mail

I have it working like this.

I've made a MailComHelper, made a method like this :

def self.welcome(user,password)
  @user = user
  m = Mail.new
  m.from    =  '[email protected]'
  m.to      = @user.email
  m.subject = 'welcome'
  m.body = 'The body'
  m.delivery_method :sendmail
  m.deliver!
end  

And it works, I receive the mail. But I wish I could use the old way of calling a view ( html.erb ) file and send that code has the body. I've read the documentation but haven't found a way to do it.

Has anyone found a way to do it?

© Stack Overflow or respective owner

Related posts about rails

Related posts about email