From 81ecf48f44546ea340055a78b60c69f5781dff1d Mon Sep 17 00:00:00 2001 From: Nadil Karunarathna Date: Mon, 27 Apr 2026 16:32:30 +0530 Subject: [PATCH 1/2] fix --- .../Controller/Integration/Relay/RelayWebhookController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/Api/Public/Controller/Integration/Relay/RelayWebhookController.php b/backend/src/Api/Public/Controller/Integration/Relay/RelayWebhookController.php index 1f90e8b9c..fc264cfa0 100644 --- a/backend/src/Api/Public/Controller/Integration/Relay/RelayWebhookController.php +++ b/backend/src/Api/Public/Controller/Integration/Relay/RelayWebhookController.php @@ -97,7 +97,7 @@ private function handleSendRecipientWebhooks(array $payload, string $event): voi $send = $payload['send']; $attempt = $payload['attempt']; - if (!isset($send['headers']['X-Newsletter-Send-ID'])) { + if (empty($send['headers']['X-Newsletter-Send-ID'])) { return; } From 24efb1666ef34975d74b65bb2bc47f5bfa109da6 Mon Sep 17 00:00:00 2001 From: Nadil Karunarathna Date: Mon, 27 Apr 2026 16:34:38 +0530 Subject: [PATCH 2/2] test --- .../Integration/Relay/RelayWebhookTest.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/backend/tests/Api/Public/Integration/Relay/RelayWebhookTest.php b/backend/tests/Api/Public/Integration/Relay/RelayWebhookTest.php index e0c7ea6ab..e67dc589f 100644 --- a/backend/tests/Api/Public/Integration/Relay/RelayWebhookTest.php +++ b/backend/tests/Api/Public/Integration/Relay/RelayWebhookTest.php @@ -62,6 +62,26 @@ public function test_send_recipient_accepted(): void $this->assertNotNull($send->getDeliveredAt()); } + public function test_ignores_for_issue_test_mail_webhook(): void + { + $data = [ + "event" => "send.recipient.accepted", + "payload" => [ + "send" => [ + "headers" => [ + "X-Newsletter-Send-ID" => "" + ] + ], + "attempt" => [ + "created_at" => 1758221942 + ] + ] + ]; + + $response = $this->callWebhook($data); + $this->assertSame(200, $response->getStatusCode()); + } + public function test_send_recipient_failed(): void { $send = SendFactory::createOne([