[Rails] ActionMailer - ROR Recipes - Multipart/alternative

softwareengineer 99 softwareengineer99 at yahoo.com
Mon Feb 6 20:59:47 GMT 2006


I am using the SaltedHashLoginGenerator. and would like to send the e-mail in multipart/alternative format.
  
  By default my application is using forgot_password_en.rhtml template.
  
  I read in the ROR Recipes book
  
  "ActionMailer sees these templates, recognizes the pattern in their
  file names, and automatically sets the MIME type of the message to
  multipart/alternative and adds each rendered view with the content type
  in its file name."
  
  So I created  forgot_password_en.text.plain.rhtml template and  forgot_password_en.text.html.rhtml templates (and removed the  forgot_password_en.rhtml template temporarily).
  
  Now my application won't send any email.
  
  How can I make ActionMailer recognize these templates and set the appropriate MIMe type?
  
  
  My mailer function looks like this:
  
    def forgot_password(member, url=nil)
      setup_email(member)
  
      # Email header info
      @subject += "Forgotten password notification"
  
      # Email body substitutions
      @body["name"] = "#{member.firstname} #{member.lastname}"
      @body["login"] = member.login
      @body["url"] = url || MemberSystem::CONFIG[:app_url].to_s
      @body["app_name"] = MemberSystem::CONFIG[:app_name].to_s
    end
  
  
  Thanks for your assistance.
  Frank
  
			
---------------------------------
 Yahoo! Mail - Helps protect you from nasty viruses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060206/0d6cafbc/attachment.html


More information about the Rails mailing list