I\'m trying to do a conditional render of a different template from ActionMailer (Rails 3.1.1). I want most users to get the normal welcome.html.erb template, but s
welcome.html.erb
The solution from Sean Hill doesn't work for me (Rails 3.2+). template_name seems to be ignored. What worked for me is something like this:
template_name
mail(:to => "#{@user.name} <#{@user.email}>", :subject => "Welcome to ...") do |format| format.html { render 'templatename' } end