code layout clean up of render_multipart() at app/models/mailer.rb

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7466 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-09-23 06:59:39 +00:00
parent b89bf7eaf1
commit cf7efe3f7d
1 changed files with 8 additions and 3 deletions

View File

@ -418,11 +418,16 @@ class Mailer < ActionMailer::Base
def render_multipart(method_name, body)
if Setting.plain_text_mail?
content_type "text/plain"
body render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
body render(:file => "#{method_name}.text.plain.rhtml",
:body => body,
:layout => 'mailer.text.plain.erb')
else
content_type "multipart/alternative"
part :content_type => "text/plain", :body => render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
part :content_type => "text/html", :body => render_message("#{method_name}.text.html.rhtml", body)
part :content_type => "text/plain",
:body => render(:file => "#{method_name}.text.plain.rhtml",
:body => body, :layout => 'mailer.text.plain.erb')
part :content_type => "text/html",
:body => render_message("#{method_name}.text.html.rhtml", body)
end
end