Skip to content

Commit ddaefc6

Browse files
authored
Merge pull request #7 from barryvdh/patch-1
Add visibleText method
2 parents 57513f7 + fa89e36 commit ddaefc6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"illuminate/log": "5.7.*",
2323
"illuminate/routing": "5.7.*",
2424
"illuminate/support": "5.7.*",
25+
"willdurand/email-reply-parser": "^2.8",
2526
"zbateson/mail-mime-parser": "^1.1"
2627
},
2728
"require-dev": {

src/InboundEmail.php

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Carbon\Carbon;
66
use Illuminate\Support\Collection;
77
use Illuminate\Support\Facades\Mail;
8+
use EmailReplyParser\EmailReplyParser;
89
use Illuminate\Contracts\Mail\Mailable;
910
use Illuminate\Database\Eloquent\Model;
1011
use ZBateson\MailMimeParser\Header\AddressHeader;
@@ -54,6 +55,11 @@ public function text(): ?string
5455
return $this->message()->getTextContent();
5556
}
5657

58+
public function visibleText(): ?string
59+
{
60+
return EmailReplyParser::parseReply($this->text());
61+
}
62+
5763
public function html(): ?string
5864
{
5965
return $this->message()->getHtmlContent();

0 commit comments

Comments
 (0)