Closed norbertszivos closed 8 years ago
mail.text?
checks for text
, which is true for both text/plain
and text/html
.
If there's only one part, there will be no html_part
or text_part
, that's why this was failing.
@Sysqa could you, please, add a few tests for this case?
My problem is that here the text?
working as I expected, but under Rails text?
is always true
except if the email is multipart. That's why we got the wrong email part. So it's hard to test something what is not happening here.
@spovich it would be very much appreciated if you could take a look at this and give your feedback. This is a pretty crucial bug to this gem.
@kshnurov thanks the mime_type
suggestion. I missed somehow. Could you check the modifications with @spovich ?
@Sysqa mail.mime_type == 'text/html' ? true : false
is equal to mail.mime_type == 'text/html'
.
true, I couldn't thinking at midnight
Just tried this branch on my project and it works like a charm, thanks @Sysqa 👍
You probably want to fix the broken spec though so it this can be merged.
@spovich it's time for a new version
@kshnurov done!
This PR is a patch for #44 issue
The problem was that on Rails if we have mailer with just an html content, than we got this message as a plain text and not html. The
mail.text?
at this case wastrue
what is not definitely not true. It looks like under Railsmail.text?
is always true if not multipart.