Permalink
Browse files

Show rich message by default (if available)

  • Loading branch information...
sidonath committed Jun 21, 2012
1 parent a289028 commit 88a707b808d5969796e2942ae6a4b8c03f5093d2
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/letter_opener/delivery_method.rb
@@ -11,7 +11,8 @@ def deliver!(mail)
messages = mail.parts.map { |part| Message.new(location, mail, part) }
messages << Message.new(location, mail) if messages.empty?
messages.each { |message| message.render }
- Launchy.open(URI.parse("file://#{messages.first.filepath}"))
+ initial_message = messages.find { |msg| msg.type == 'rich' } || messages.first
+ Launchy.open(URI.parse("file://#{initial_message.filepath}"))
end
end
end

0 comments on commit 88a707b

Please sign in to comment.