ddeboer / imap

Object-oriented, fully tested PHP IMAP library
MIT License
889 stars 253 forks source link

Method to get all html parts and complete html body #557

Closed arwinvdv closed 1 year ago

arwinvdv commented 1 year ago

When you create an email in Apple Mail and drag an PDF file in the middle of my email (so with text around) and send it, the getBodyHtml only returns the first part of the e-mail.

I added two methods $message->getBodyHtmlParts() and $message->getCompleteBodyHtml(). I don't know if there is a better implementation without DOMDocument. I'd love to hear if improvements are possible. I think its better to rename the $message->getBodyHtml() to for example $message->getFirstBodyHtml() but I don't want to break to much.

Fixes for: https://github.com/ddeboer/imap/issues/452 https://github.com/ddeboer/imap/pull/454

codecov[bot] commented 1 year ago

Codecov Report

Base: 94.76% // Head: 94.86% // Increases project coverage by +0.10% :tada:

Coverage data is based on head (10dc04f) compared to base (a238641). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #557 +/- ## ============================================ + Coverage 94.76% 94.86% +0.10% - Complexity 356 368 +12 ============================================ Files 45 45 Lines 898 935 +37 ============================================ + Hits 851 887 +36 - Misses 47 48 +1 ``` | [Impacted Files](https://codecov.io/gh/ddeboer/imap/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer) | Coverage Δ | | |---|---|---| | [src/Message/AbstractMessage.php](https://codecov.io/gh/ddeboer/imap/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer#diff-c3JjL01lc3NhZ2UvQWJzdHJhY3RNZXNzYWdlLnBocA==) | `100.00% <100.00%> (ø)` | | | [src/Message/AbstractPart.php](https://codecov.io/gh/ddeboer/imap/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer#diff-c3JjL01lc3NhZ2UvQWJzdHJhY3RQYXJ0LnBocA==) | `95.51% <0.00%> (-0.41%)` | :arrow_down: | | [src/Message/EmbeddedMessage.php](https://codecov.io/gh/ddeboer/imap/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer#diff-c3JjL01lc3NhZ2UvRW1iZWRkZWRNZXNzYWdlLnBocA==) | `100.00% <0.00%> (ø)` | | | [src/Message.php](https://codecov.io/gh/ddeboer/imap/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer#diff-c3JjL01lc3NhZ2UucGhw) | `85.84% <0.00%> (+0.25%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=David+de+Boer)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Slamdunk commented 1 year ago

Don't care about the composer-unused issue: https://github.com/shivammathur/setup-php/issues/703