Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 58a4d30

Browse filesBrowse files
bug #59375 [RemoteEvent][Webhook] fix SendgridPayloadConverter category support (ericabouaf)
This PR was merged into the 6.4 branch. Discussion ---------- [RemoteEvent][Webhook] fix SendgridPayloadConverter category support | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #59374 | License | MIT Commits ------- 186daa5 [Webhook][RemoteEvent] fix SendgridPayloadConverter category support
2 parents 09c925b + 186daa5 commit 58a4d30
Copy full SHA for 58a4d30

File tree

2 files changed

+17
-1
lines changed
Filter options

2 files changed

+17
-1
lines changed

‎src/Symfony/Component/Mailer/Bridge/Sendgrid/RemoteEvent/SendgridPayloadConverter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/RemoteEvent/SendgridPayloadConverter.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function convert(array $payload): AbstractMailerEvent
5151
$event->setDate($date);
5252
$event->setRecipientEmail($payload['email']);
5353
$event->setMetadata([]);
54-
$event->setTags($payload['category'] ?? []);
54+
$event->setTags((array) ($payload['category'] ?? []));
5555

5656
return $event;
5757
}

‎src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/RemoteEvent/SendgridPayloadConverterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/RemoteEvent/SendgridPayloadConverterTest.php
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,20 @@ public function testAsynchronousBounce()
112112
$this->assertInstanceOf(MailerDeliveryEvent::class, $event);
113113
$this->assertSame('123456', $event->getId());
114114
}
115+
116+
public function testWithStringCategory()
117+
{
118+
$converter = new SendgridPayloadConverter();
119+
120+
$event = $converter->convert([
121+
'event' => 'processed',
122+
'sg_message_id' => '123456',
123+
'timestamp' => '123456789',
124+
'email' => 'test@example.com',
125+
'category' => 'cat facts',
126+
]);
127+
128+
$this->assertInstanceOf(MailerDeliveryEvent::class, $event);
129+
$this->assertSame(['cat facts'], $event->getTags());
130+
}
115131
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.