simplification de l'accès au corps en texte brut

This commit is contained in:
Jérémy Lecour 2020-12-28 00:52:20 +01:00
parent c35e20d314
commit d13dd70fd1

View file

@ -32,9 +32,7 @@ class InMailbox < ApplicationMailbox
def text_plain_body(mail)
if mail.parts.present?
mail.parts.detect(-> { mail.parts[0] }) { |part|
part.content_type =~ /text\/plain/
}.body.decoded
mail.text_part.decoded
else
mail.decoded
end