Forum: Ruby on Rails Rails3 Mailer html / text versions order

Posted by Kad Kerforn (kadoudal)
on 2011-07-07 18:38
(Received via mailing list)
I am sending the emails  as per the documentation  order  :  html /
text
but users are receiving the text version first and not the html ( need
to switch to an alternative version ..)
I guess I missed a point but which one ?

thanks for your help

RAILS DOC ========
class UserMailer < ActionMailer::Base
  default :from => "notifications@example.com"

  def welcome_email(user)
    @user = user
    @url  = "http://example.com/login"
    mail(:to => user.email,
         :subject => "Welcome to My Awesome Site") do |format|
      format.html { render 'another_template' }
      format.text { render 'another_template' }
    end
  end

MY USER MAILER =======
def analysis_received(user_id, clip_id, request_id)
     ......  skipped lines ......
     @template = "user_mailer/#{I18n.locale.to_s}/
analysis_received.erb"
       mail(:to => @user[:email], :subject =>
"#{@request_type.capitalize}") do |format|
          format.html { render  :template => @template }
          format.text {render :layout => false, :template =>
@template}
       end
    end
end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.