Skip to content

Commit 98a7214

Browse files
[Mailer] Fix date parsing remote event payload converter
1 parent 3903840 commit 98a7214

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

src/Symfony/Component/Mailer/Bridge/MailerSend/RemoteEvent/MailerSendPayloadConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function convert(array $payload): AbstractMailerEvent
4343
$event = new MailerEngagementEvent($name, $this->getMessageId($payload), $payload);
4444
}
4545

46-
if (!$date = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', $payload['created_at'])) {
46+
if (!$date = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', $payload['created_at'])) {
4747
throw new ParseException(sprintf('Invalid date "%s".', $payload['created_at']));
4848
}
4949

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/clicked.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
'ip' => '127.0.0.1',
1010
'url' => 'https://www.mailersend.com'
1111
]);
12-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
12+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1313

1414
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/clicked_unique.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
'ip' => '127.0.0.1',
1010
'url' => 'https://www.mailersend.com'
1111
]);
12-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
12+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1313

1414
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/delivered.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
$wh->setTags(["test-tag"]);
88
$wh->setMetadata([]);
99
$wh->setReason('');
10-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
10+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1111

1212
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/hard_bounced.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
$wh->setTags(["test-tag"]);
88
$wh->setMetadata([]);
99
$wh->setReason('Host or domain name not found');
10-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
10+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1111

1212
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/opened.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
$wh->setMetadata([
99
'ip' => '127.0.0.1'
1010
]);
11-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
11+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1212

1313
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/opened_unique.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
$wh->setMetadata([
99
'ip' => '127.0.0.1'
1010
]);
11-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
11+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1212

1313
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/sent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
$wh->setTags(["test-tag"]);
88
$wh->setMetadata([]);
99
$wh->setReason('');
10-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
10+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1111

1212
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/soft_bounced.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
$wh->setTags(["test-tag"]);
88
$wh->setMetadata([]);
99
$wh->setReason('Unknown reason');
10-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
10+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1111

1212
return $wh;

src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/Fixtures/spam_complaint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
$wh->setRecipientEmail('[email protected]');
77
$wh->setTags(["test-tag"]);
88
$wh->setMetadata([]);
9-
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', '2024-01-01T12:00:00.000000Z'));
9+
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-01-01T12:00:00.000000Z'));
1010

1111
return $wh;

0 commit comments

Comments
 (0)