I believe that an alternative would be to specify the template you want to display with the following example of how you can do this
class SecurityUserMailer < ActionMailer::Base default from: ' myemail@gmail.com ' def password_reset(security_user) @security_user = security_user mail to: security_user.email, subject: 'Password Reset' end def email_confirmation(security_user) @security_user = security_user mail (:to => security_user.email, :subject => 'Account Created', :template_path => 'email_confirmation.txt.erb', :template_name => 'another') end end
Take a look at the following for more information:
Mailer Views
or look
Api Ruby on Rails You will see an example where he says Or even render a special view , otherwise you could have the following inside your mail block:
mail (:to => security_user.email, :subject => 'Account Created') do |format| format.html { render 'another_template' } format.text { render :text => 'email_confirmation.txt.erb' } end
This should shed light on what you are trying to accomplish.
David source share