Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[RemoteEvent][Webhook] Add Brevo support#51264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/RemoteEvent/BrevoPayloadConverter.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace Symfony\Component\Mailer\Bridge\Brevo\RemoteEvent; | ||
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent; | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent; | ||
use Symfony\Component\RemoteEvent\Exception\ParseException; | ||
use Symfony\Component\RemoteEvent\PayloadConverterInterface; | ||
final class BrevoPayloadConverter implements PayloadConverterInterface | ||
{ | ||
public function convert(array $payload): AbstractMailerEvent | ||
{ | ||
if (\in_array($payload['event'], ['request', 'deferred', 'delivered', 'soft_bounce', 'hard_bounce', 'invalid_email', 'blocked', 'error'], true)) { | ||
$name = match ($payload['event']) { | ||
'request' => MailerDeliveryEvent::RECEIVED, | ||
'deferred' => MailerDeliveryEvent::DEFERRED, | ||
'delivered' => MailerDeliveryEvent::DELIVERED, | ||
'soft_bounce' => MailerDeliveryEvent::BOUNCE, | ||
'hard_bounce' => MailerDeliveryEvent::BOUNCE, | ||
'invalid_email' => MailerDeliveryEvent::DROPPED, | ||
'blocked' => MailerDeliveryEvent::DROPPED, | ||
'error' => MailerDeliveryEvent::DROPPED, | ||
}; | ||
$event = new MailerDeliveryEvent($name, $payload['message-id'], $payload); | ||
} else { | ||
$name = match ($payload['event']) { | ||
'click' => MailerEngagementEvent::CLICK, | ||
'unsubscribed' => MailerEngagementEvent::UNSUBSCRIBE, | ||
'unique_opened' => MailerEngagementEvent::OPEN, | ||
'opened' => MailerEngagementEvent::OPEN, | ||
'proxy_open' => MailerEngagementEvent::OPEN, | ||
'complaint' => MailerEngagementEvent::SPAM, | ||
default => throw new ParseException(sprintf('Unsupported event "%s".', $payload['event'])), | ||
}; | ||
$event = new MailerEngagementEvent($name, $payload['message-id'], $payload); | ||
} | ||
if (!$date = \DateTimeImmutable::createFromFormat('U', $payload['ts_event'])) { | ||
throw new ParseException(sprintf('Invalid date "%s".', $payload['ts_event'])); | ||
} | ||
if ( | ||
\in_array($payload['event'], ['deferred', 'soft_bounce', 'hard_bounce', 'invalid_email', 'blocked', 'error'], true) | ||
&& isset($payload['reason']) | ||
) { | ||
$event->setReason($payload['reason']); | ||
} | ||
$event->setDate($date); | ||
$event->setRecipientEmail($payload['email']); | ||
$event->setTags($payload['tags']); | ||
return $event; | ||
} | ||
} |
25 changes: 25 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/BrevoRequestParserTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace Symfony\Component\Mailer\Bridge\Brevo\Tests\Webhook; | ||
use Symfony\Component\Mailer\Bridge\Brevo\RemoteEvent\BrevoPayloadConverter; | ||
use Symfony\Component\Mailer\Bridge\Brevo\Webhook\BrevoRequestParser; | ||
use Symfony\Component\Webhook\Client\RequestParserInterface; | ||
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase; | ||
class BrevoRequestParserTest extends AbstractRequestParserTestCase | ||
{ | ||
protected function createRequestParser(): RequestParserInterface | ||
{ | ||
return new BrevoRequestParser(new BrevoPayloadConverter()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/blocked.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"id": 814119, | ||
"email": "example@gmail.com", | ||
"message-id": "<202305311400.29297141656@smtp-relay.mailin.fr>", | ||
"date": "2023-05-31 16:00:08", | ||
"tags": [ | ||
"tag1", | ||
"tag2" | ||
], | ||
"tag": "[\"tag1\",\"tag2\"]", | ||
"event": "blocked", | ||
"subject": "Subject Line", | ||
"ts_event": 1685541608, | ||
"ts": 1685541608, | ||
"reason": "blocked : due to unsubscribed user", | ||
"ts_epoch": 1685541608993 | ||
} |
11 changes: 11 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/blocked.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::DROPPED, '<202305311400.29297141656@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['tag1', 'tag2']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1685541608)); | ||
$wh->setReason('blocked : due to unsubscribed user'); | ||
return $wh; |
18 changes: 18 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/click.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"id": 814119, | ||
"email": "example@gmail.com", | ||
"message-id": "<202305311408.17112967225@smtp-relay.mailin.fr>", | ||
"date": "2023-05-31 16:08:28", | ||
"tags": [ | ||
"welcome", | ||
"tag2" | ||
], | ||
"tag": "[\"welcome\",\"tag2\"]", | ||
"event": "click", | ||
"subject": "Subject Line", | ||
"sending_ip": "127.0.0.1", | ||
"ts": 1685542108, | ||
"ts_epoch": 1685542108462, | ||
"ts_event": 1685542108, | ||
"link": "https://www.google.com" | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/click.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent; | ||
$wh = new MailerEngagementEvent(MailerEngagementEvent::CLICK, '<202305311408.17112967225@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['welcome', 'tag2']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1685542108)); | ||
return $wh; |
11 changes: 11 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/complaint.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"event": "complaint", | ||
"email": "example@gmail.com", | ||
"id": 814119, | ||
"date": "2020-10-09 00:00:00", | ||
"ts": 1604933619, | ||
"message-id": "<201798300811.5787683@smtp-relay.mailin.fr>", | ||
"ts_event": 1604933654, | ||
"X-Mailin-custom": "some_custom_header", | ||
"tags": ["transac_messages"] | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/complaint.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent; | ||
$wh = new MailerEngagementEvent(MailerEngagementEvent::SPAM, '<201798300811.5787683@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['transac_messages']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1604933654)); | ||
return $wh; |
16 changes: 16 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/defered.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"event":"deferred", | ||
"email": "example@domain.com", | ||
"id": 814119, | ||
"date": "2020-10-09 00:00:00", | ||
"ts": 1604933619, | ||
"message-id": "<202305311400.29297141656@smtp-relay.mailin.fr>", | ||
"ts_event": 1604933654, | ||
"subject": "My first Transactional", | ||
"X-Mailin-custom": "some_custom_header", | ||
"sending_ip": "127.0.0.1", | ||
"ts_epoch": 1604933654, | ||
"template_id": 22, | ||
"tags": ["transac_messages"], | ||
"reason": "spam" | ||
} |
11 changes: 11 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/defered.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::DEFERRED, '<202305311400.29297141656@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@domain.com'); | ||
$wh->setTags(['transac_messages']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1604933654)); | ||
$wh->setReason('spam'); | ||
return $wh; |
18 changes: 18 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/delivered.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"id": 814119, | ||
"email": "example@gmail.com", | ||
"message-id": "<202305311328.81899448177@smtp-relay.mailin.fr>", | ||
"date": "2023-05-31 15:28:33", | ||
"tags": [ | ||
"tag1", | ||
"tag2" | ||
], | ||
"tag": "[\"tag1\",\"tag2\"]", | ||
"event": "delivered", | ||
"subject": "Subject Line", | ||
"sending_ip": "127.0.0.1", | ||
"ts_event": 1685539713, | ||
"ts": 1685539713, | ||
"reason": "sent", | ||
"ts_epoch": 1685539713018 | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/delivered.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::DELIVERED, '<202305311328.81899448177@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['tag1', 'tag2']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1685539713)); | ||
return $wh; |
14 changes: 14 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/error.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"event": "invalid_email", | ||
"email": "example@gmail.com", | ||
"id": 814119, | ||
"date": "2020-10-09 00:00:00", | ||
"ts": 1604933619, | ||
"message-id": "<201798300811.5787683@smtp-relay.mailin.fr>", | ||
"ts_event": 1604933654, | ||
"subject": "My first Transactional", | ||
"X-Mailin-custom": "some_custom_header", | ||
"template_id": 22, | ||
"tags": ["transac_messages"], | ||
"ts_epoch": 1604933623 | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/error.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::DROPPED, '<201798300811.5787683@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['transac_messages']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1604933654)); | ||
return $wh; |
18 changes: 18 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/hard_bounce.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"id": 814119, | ||
"email": "example@gmail.com", | ||
"message-id": "<202305311437.85220493321@smtp-relay.mailin.fr>", | ||
"date": "2023-05-31 16:37:07", | ||
"tags": [ | ||
"welcome", | ||
"tag2" | ||
], | ||
"tag": "[\"welcome\",\"tag2\"]", | ||
"event": "hard_bounce", | ||
"subject": "Subject Line", | ||
"sending_ip": "127.0.0.1", | ||
"ts_event": 1685543827, | ||
"ts": 1685543827, | ||
"reason": "550-5.1.1 The email account that you tried to reach does not exist. Please try\n 550-5.1.1 double-checking the recipient's email address for typos or\n 550-5.1.1 unnecessary spaces. Learn more at\n 550 5.1.1 https://support.google.com/mail/?p=NoSuchUser g14-20020a5d698e000000b0030aefbb8608si2668200wru.496 - gsmtp", | ||
"ts_epoch": 1685543827372 | ||
} |
11 changes: 11 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/hard_bounce.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::BOUNCE, '<202305311437.85220493321@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['welcome', 'tag2']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1685543827)); | ||
$wh->setReason("550-5.1.1 The email account that you tried to reach does not exist. Please try\n 550-5.1.1 double-checking the recipient's email address for typos or\n 550-5.1.1 unnecessary spaces. Learn more at\n 550 5.1.1 https://support.google.com/mail/?p=NoSuchUser g14-20020a5d698e000000b0030aefbb8608si2668200wru.496 - gsmtp"); | ||
return $wh; |
14 changes: 14 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/invalid_email.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"event": "invalid_email", | ||
"email": "example@gmail.com", | ||
"id": 625895, | ||
"date": "2020-10-09 00:00:00", | ||
"ts": 1604933619, | ||
"message-id": "<201798300811.5787683@smtp-relay.mailin.fr>", | ||
"ts_event": 1604933654, | ||
"subject": "My first Transactional", | ||
"X-Mailin-custom": "some_custom_header", | ||
"template_id": 22, | ||
"tags": ["transac_messages"], | ||
"ts_epoch": 1604933623 | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/invalid_email.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent; | ||
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::DROPPED, '<201798300811.5787683@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['transac_messages']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1604933654)); | ||
return $wh; |
18 changes: 18 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/opened.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"id": 814119, | ||
"email": "example@gmail.com", | ||
"message-id": "<202305311408.17112967225@smtp-relay.mailin.fr>", | ||
"date": "2023-05-31 16:45:09", | ||
"tags": [ | ||
"welcome", | ||
"tag2" | ||
], | ||
"tag": "[\"welcome\",\"tag2\"]", | ||
"event": "opened", | ||
"subject": "Subject Line", | ||
"sending_ip": "127.0.0.1", | ||
"ts": 1685544309, | ||
"ts_epoch": 1685544309368, | ||
"ts_event": 1685544309, | ||
"link": "" | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/opened.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent; | ||
$wh = new MailerEngagementEvent(MailerEngagementEvent::OPEN, '<202305311408.17112967225@smtp-relay.mailin.fr>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['welcome', 'tag2']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1685544309)); | ||
return $wh; |
14 changes: 14 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/proxy_open.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"event": "proxy_open", | ||
"email": "example@gmail.com", | ||
"id": 1, | ||
"date": "2020-10-09 00:00:00", | ||
"message-id": "<201798300811.5787683@relay.domain.com>", | ||
"subject": "My first Transactional", | ||
"tags": ["transactionalTag"], | ||
"sending_ip": "127.0.0.1", | ||
"s_epoch": 1534486682000, | ||
"template_id": 1, | ||
"ts": 1604933654, | ||
"ts_event": 1604933654 | ||
} |
10 changes: 10 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/proxy_open.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent; | ||
$wh = new MailerEngagementEvent(MailerEngagementEvent::OPEN, '<201798300811.5787683@relay.domain.com>', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true, flags: JSON_THROW_ON_ERROR)); | ||
$wh->setRecipientEmail('example@gmail.com'); | ||
$wh->setTags(['transactionalTag']); | ||
$wh->setDate(\DateTimeImmutable::createFromFormat('U', 1604933654)); | ||
return $wh; |
18 changes: 18 additions & 0 deletionssrc/Symfony/Component/Mailer/Bridge/Brevo/Tests/Webhook/Fixtures/request.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"id": 814119, | ||
"email": "example@gmail.com", | ||
"message-id": "<202305311313.92192897094@smtp-relay.mailin.fr>", | ||
"date": "2023-05-31 15:13:08", | ||
"tags": [ | ||
"tag1", | ||
"tag2" | ||
], | ||
"tag": "[\"tag1\",\"tag2\"]", | ||
"event": "request", | ||
"subject": "Subject Line", | ||
"sending_ip": "127.0.0.1", | ||
"ts_event": 1685538788, | ||
"ts": 1685538788, | ||
"reason": "sent", | ||
"ts_epoch": 1685538788179 | ||
} |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.