Permalink
Browse files

Ensure templates are rendered if all the parts are already processed

  • Loading branch information...
1 parent 2561be0 commit 04248c62086b188ae354ed90ae40c832b79fd19c @josh josh committed Aug 14, 2008
@@ -470,8 +470,9 @@ def create!(method_name, *parameters) #:nodoc:
# also render a "normal" template (without the content type). If a
# normal template exists (or if there were no implicit parts) we render
# it.
- template = template_root["#{mailer_name}/#{@template}"]
- @body = render_message(@template, @body) if template
+ template_exists = @parts.empty?
+ template_exists ||= template_root["#{mailer_name}/#{@template}"]
+ @body = render_message(@template, @body) if template_exists
# Finally, if there are other message parts and a textual body exists,
# we shift it onto the front of the parts and set the body to nil (so

0 comments on commit 04248c6

Please sign in to comment.