Skip to content

Commit

Permalink
Show rich message by default (if available)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidonath committed Jun 21, 2012
1 parent a289028 commit 88a707b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/letter_opener/delivery_method.rb
Expand Up @@ -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.