feat: disable mailjet open and click tracking

This commit is contained in:
fromme committed 2026-11-10 17:25:16 +01:00
1 parent 77960fe81f
commit 980e378a7b
2 files changed
+45

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace App\Tests\Email;
use App\Email\Mailer;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\BodyRendererInterface;
class MailerTest extends TestCase
{
/**
* Mailjet would otherwise track opens and rewrite links if the account is set to.
*/
public function testMailIsNotTracked(): void
{
$mailer = new Mailer(
$this->createStub(MailerInterface::class),
$this->createStub(BodyRendererInterface::class),
new NullLogger(),
[],
);
$headers = $mailer->create([], [
'from' => '[email protected]',
'subject' => 'Betreff',
'template' => 'email/test.html.twig',
'attachments' => [],
])->getHeaders();
self::assertSame('0', $headers->get('X-Mailjet-TrackOpen')?->getBodyAsString());
self::assertSame('0', $headers->get('X-Mailjet-TrackClick')?->getBodyAsString());
}
}