Skip to content

Commit

Permalink
Insert tracking pixel after <body> tag open.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjarrett authored and jdavidbakr committed Sep 26, 2024
1 parent 227b2d2 commit aaa7730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MailTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function injectTrackingPixel($html, $hash)
$html = str_replace("\n", $linebreak, $html);

if (preg_match("/^(.*<body[^>]*>)(.*)$/", $html, $matches)) {
$html = $matches[1].$matches[2].$tracking_pixel;
$html = $matches[1].$tracking_pixel.$matches[2];
} else {
$html = $html . $tracking_pixel;
}
Expand Down

0 comments on commit aaa7730

Please sign in to comment.