Closed JapSeyz closed 2 years ago
Adding this part to createTrackers
, inside the foreach ($messageBody->getParts as $part) {
in MailTracker.php
fixes the issue:
if (method_exists($part, 'getParts')) {
foreach ($part->getParts() as $p) {
if($p->getMediaSubtype() == 'html') {
$original_html = $p->getBody();
$newParts[] = new TextPart(
$this->addTrackers($original_html, $hash),
$message->getHtmlCharset(),
$p->getMediaSubtype(),
null
);
break;
}
}
}
I've added it above above the usual code in the loop. Right above this line:
https://github.com/jdavidbakr/mail-tracker/blob/master/src/MailTracker.php#L200
@JapSeyz if you want to go ahead and make a PR (be sure to include a test) I'll accept it, otherwise I'll try to look at it before too long.
I’ll try and get a PR going, just wanted to note everything down before signing off yesterday :) On 24 May 2022, 15.06 +0200, J David Baker @.***>, wrote:
@JapSeyz if you want to go ahead and make a PR (be sure to include a test) I'll accept it, otherwise I'll try to look at it before too long. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
A markdown email w/o attachments has the following
$part->getMediaSubtype
s:Whereas simply adding two attachments like so:
Changes the Media Subtypes to:
Inside the alternative is the html and plain contents, but they're never checked.
Here it is with
$part->asDebugString()
logged too: