prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
Event\Event\Mailer\MailerDeliveryEvent;
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::BOUNCE, 'f11f4fe2-fb05-4882-8303-a20956d47931', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetadata([
'x-campaign-type' => 'default... | t',
'x-campaign-id' => 'b20dsfsdfds6-9595b5-9595a7-565b9-5e2b826595053',
'x-campaign-canal' => 'mycanal',
'x-transaction-id' => 'f11f4fe2-fb05-4882-8303-a20956d47931',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-08-2 | -ref' => '895000N',
'x-campaign-pool' => 'defaul | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/soft-bounce.php",
"language": "php",
"file_size": 889,
"cut_index": 547,
"middle_length": 52
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport\Smtp;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\Smtp... | t(), new NullLogger());
}
public static function supportsProvider(): iterable
{
yield [
new Dsn('smtp', 'example.com'),
true,
];
yield [
new Dsn('smtps', 'example.com'),
| sportFactoryInterface;
class EsmtpTransportFactoryTest extends AbstractTransportFactoryTestCase
{
public function getFactory(): TransportFactoryInterface
{
return new EsmtpTransportFactory(null, new MockHttpClien | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/Smtp/EsmtpTransportFactoryTest.php",
"language": "php",
"file_size": 6884,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport\Smtp;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Component\Mailer\Event\SentMessageEvent;
use Symfony\Com... | ;
use Symfony\Component\Mime\Part\DataPart;
use Symfony\Component\Mime\Part\File;
use Symfony\Component\Mime\RawMessage;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
#[Group('time-sensitive')]
class SmtpTransportTest extends TestCase
{
| port\Smtp\Stream\AbstractStream;
use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Exception\InvalidArgumentException | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/Smtp/SmtpTransportTest.php",
"language": "php",
"file_size": 7644,
"cut_index": 716,
"middle_length": 229
} |
?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\Tests\Transport\Smtp\Stream;
use PHPUnit\Framew... | ult .= $chunk;
}
$this->assertSame($expected, $result);
}
public static function provideReplace()
{
yield ['ca', 'ab', 'c', ['a', 'b', 'a']];
yield ['ac', 'ab', 'c', ['a', 'ab']];
yield ['cbc', 'aba', ' | 'provideReplace')]
public function testReplace(string $expected, string $from, string $to, array $chunks)
{
$result = '';
foreach (AbstractStream::replace($from, $to, $chunks) as $chunk) {
$res | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/Smtp/Stream/AbstractStreamTest.php",
"language": "php",
"file_size": 1028,
"cut_index": 513,
"middle_length": 229
} |
ge.
*
* (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\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester... | k(TransportInterface::class);
$mailer
->expects($this->once())
->method('send')
->with(self::callback(static fn (Email $message) => [$from, $to, $subject, $body] === [
$message->getFrom()[0]->getA | Case
{
public function testSendsEmail()
{
$from = 'from@example.com';
$to = 'to@example.com';
$subject = 'Foobar';
$body = 'Lorem ipsum dolor sit amet.';
$mailer = $this->createMoc | {
"filepath": "src/Symfony/Component/Mailer/Tests/Command/MailerTestCommandTest.php",
"language": "php",
"file_size": 2027,
"cut_index": 563,
"middle_length": 229
} |
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\Tests\EventListener;
use PHPUnit\Framework\Attributes\DataProvider;
use... | ll, array $allowedRecipients = [])
{
$listener = new EnvelopeListener(null, $recipients, $allowedRecipients);
$message = new RawMessage('message');
$envelope = new Envelope(new Address('sender@example.com'), [new Address('r1@exa | mponent\Mime\Address;
use Symfony\Component\Mime\RawMessage;
class EnvelopeListenerTest extends TestCase
{
#[DataProvider('provideRecipientsTests')]
public function testRecipients(array $expected, ?array $recipients = nu | {
"filepath": "src/Symfony/Component/Mailer/Tests/EventListener/EnvelopeListenerTest.php",
"language": "php",
"file_size": 1904,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\EventListener;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
u... | e;
use Symfony\Component\Mime\Part\SMimePart;
use Symfony\Component\Mime\Part\TextPart;
class SmimeEncryptedMessageListenerTest extends TestCase
{
#[RequiresPhpExtension('openssl')]
public function testSmimeMessageEncryptionProcess()
{
| Listener;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Header\MailboxListHeader;
use Symfony\Component\Mime\Header\UnstructuredHeader;
use Symfony\Component\Mime\Messag | {
"filepath": "src/Symfony/Component/Mailer/Tests/EventListener/SmimeEncryptedMessageListenerTest.php",
"language": "php",
"file_size": 4382,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Event;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\LogicExcepti... | mps = [];
public function __construct(
private RawMessage $message,
private Envelope $envelope,
private string $transport,
private bool $queued = false,
) {
}
public function getMessage(): RawMessage
{
| the Envelope before the email is sent.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
final class MessageEvent extends Event
{
private bool $rejected = false;
/** @var StampInterface[] */
private array $sta | {
"filepath": "src/Symfony/Component/Mailer/Event/MessageEvent.php",
"language": "php",
"file_size": 2328,
"cut_index": 563,
"middle_length": 229
} |
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\EventListener;
use Symfony\Component\EventDispatcher\Event... | ion onMessage(MessageEvent $event): void
{
if (!$event->isQueued()) {
return;
}
$message = $event->getMessage();
if (!$message instanceof Message || !$message->getHeaders()->has('X-Bus-Transport')) {
| be sent to specific Messenger transports via the "X-Bus-Transport" MIME header.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
final class MessengerTransportListener implements EventSubscriberInterface
{
public funct | {
"filepath": "src/Symfony/Component/Mailer/EventListener/MessengerTransportListener.php",
"language": "php",
"file_size": 1438,
"cut_index": 524,
"middle_length": 229
} |
hp
/*
* 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\EventListener;
use Symfony\Component\EventDispatc... | ssageEvent $event): void
{
$message = $event->getMessage();
if (!$message instanceof Message) {
return;
}
$event->setMessage($this->signer->sign($message));
}
public static function getSubscribedEve | /MIME.
*
* @author Elías Fernández
*/
class SmimeSignedMessageListener implements EventSubscriberInterface
{
public function __construct(
private SMimeSigner $signer,
) {
}
public function onMessage(Me | {
"filepath": "src/Symfony/Component/Mailer/EventListener/SmimeSignedMessageListener.php",
"language": "php",
"file_size": 1113,
"cut_index": 515,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests;
use PHPUnit\Framework\TestCase;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use ... | \MessageBus;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Stamp\StampInterface;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\RawMessage;
class MailerTest extends T | ;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Transport\AbstractTransport;
use Symfony\Component\Mailer\Transport\NullTransport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger | {
"filepath": "src/Symfony/Component/Mailer/Tests/MailerTest.php",
"language": "php",
"file_size": 4149,
"cut_index": 614,
"middle_length": 229
} |
/*
* 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\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\C... | ertSame($r, $m->getOriginalMessage());
$this->assertSame($r, $m->getMessage());
$this->assertSame($e, $m->getEnvelope());
$this->assertEquals($r->toString(), $m->toString());
$this->assertEquals($r->toIterable(), $m->toItera | ageTest extends TestCase
{
public function test()
{
$m = new SentMessage($r = new RawMessage('Email'), $e = new Envelope(new Address('fabien@example.com'), [new Address('helene@example.com')]));
$this->ass | {
"filepath": "src/Symfony/Component/Mailer/Tests/SentMessageTest.php",
"language": "php",
"file_size": 1251,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Exception;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ClassExistsMock;
use Symfony\Component\Mailer\Bridge\AhaSend\Tran... | \Component\Mailer\Bridge\Mailchimp\Transport\MandrillTransportFactory;
use Symfony\Component\Mailer\Bridge\MailerSend\Transport\MailerSendTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory;
use Symfony\Component | Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory;
use Symfony\Component\Mailer\Bridge\Infobip\Transport\InfobipTransportFactory;
use Symfony | {
"filepath": "src/Symfony/Component/Mailer/Tests/Exception/UnsupportedSchemeExceptionTest.php",
"language": "php",
"file_size": 6018,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Transport\FailoverTransport;
use Symfony\Component\Mailer\Transport\Round... | Interface::class);
$t1->expects($this->once())->method('__toString')->willReturn('t1://local');
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->once())->method('__toString')->willReturn('t2://local');
| public function testSendNoTransports()
{
$this->expectException(TransportException::class);
new FailoverTransport([]);
}
public function testToString()
{
$t1 = $this->createMock(Transport | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/FailoverTransportTest.php",
"language": "php",
"file_size": 6896,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Exception\UnsupportedSc... |
public static array $fakeConfiguration = [];
public static function setUpBeforeClass(): void
{
$namespace = str_replace('\\Tests\\', '\\', __NAMESPACE__);
$current = static::class;
$eval = <<<EOT
namespac | Component\Mailer\Transport\Smtp\SmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream;
use Symfony\Component\Mailer\Transport\TransportInterface;
final class NativeTransportFactoryTest extends TestCase
{ | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php",
"language": "php",
"file_size": 4323,
"cut_index": 614,
"middle_length": 229
} |
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\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClie... | tFactory(): TransportFactoryInterface
{
return new SendmailTransportFactory(null, new MockHttpClient(), new NullLogger());
}
public static function supportsProvider(): iterable
{
yield [
new Dsn('sendmail+smtp', | Symfony\Component\Mailer\Transport\SendmailTransportFactory;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
class SendmailTransportFactoryTest extends AbstractTransportFactoryTestCase
{
public function ge | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/SendmailTransportFactoryTest.php",
"language": "php",
"file_size": 1795,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport\Smtp;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream;
... | }
public function setHost(string $host): static
{
return $this;
}
public function setPort(int $port): static
{
return $this;
}
public function write(string $bytes, $debug = true): void
{
if ($th | $this->closed = false;
$this->nextResponse = '220 localhost ESMTP';
}
public function disableTls(): static
{
return $this;
}
public function isTLS(): bool
{
return false;
| {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/Smtp/DummyStream.php",
"language": "php",
"file_size": 3577,
"cut_index": 614,
"middle_length": 229
} |
onent\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Transport\Smtp\Auth\CramMd5Authenticator;
use Symfony\Component\Mailer\Transport\Smtp\Auth\LoginAuthenticator;
use Symfony\Component\Mailer\Transport\Smtp\Auth\XOAuth2Authenticator;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Sy... | Equals('smtp://example.com', (string) $t);
}
$t = new EsmtpTransport('example.com', 2525);
$this->assertEquals('smtp://example.com:2525', (string) $t);
$t = new EsmtpTransport('example.com', 0, true);
$this->assert | st', (string) $t);
$t = new EsmtpTransport('example.com');
if (\defined('OPENSSL_VERSION_NUMBER')) {
$this->assertEquals('smtps://example.com', (string) $t);
} else {
$this->assert | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/Smtp/EsmtpTransportTest.php",
"language": "php",
"file_size": 13068,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (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\Tests\EventListener;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework... | rt;
class DkimSignedMessageListenerTest extends TestCase
{
#[RequiresPhpExtension('openssl')]
public function testDkimMessageSigningProcess()
{
$signer = new DkimSigner(<<<KEY
-----BEGIN RSA PRIVATE KEY-----
MII | ime\Address;
use Symfony\Component\Mime\Crypto\DkimSigner;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Header\MailboxListHeader;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\Part\TextPa | {
"filepath": "src/Symfony/Component/Mailer/Tests/EventListener/DkimSignedMessageListenerTest.php",
"language": "php",
"file_size": 2827,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (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\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
use S... | $l = new MessengerTransportListener();
$envelope = new Envelope(new Address('sender@example.com'), [new Address('recipient@example.com')]);
$message = new Message(new Headers());
$event = new MessageEvent($message, $envelope, 'smtp | ent\Mime\Address;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Message;
class MessengerTransportListenerTest extends TestCase
{
public function testNoMessengerTransportStampsByDefault()
{
| {
"filepath": "src/Symfony/Component/Mailer/Tests/EventListener/MessengerTransportListenerTest.php",
"language": "php",
"file_size": 2738,
"cut_index": 563,
"middle_length": 229
} |
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\Event;
use Symfony\Component\Mime\RawMessage;
/**
* @author Fabien Po... | return array_keys($this->transports);
}
/**
* @return MessageEvent[]
*/
public function getEvents(?string $name = null): array
{
if (null === $name) {
return $this->events;
}
$events = | rray $transports = [];
public function add(MessageEvent $event): void
{
$this->events[] = $event;
$this->transports[$event->getTransport()] = true;
}
public function getTransports(): array
{
| {
"filepath": "src/Symfony/Component/Mailer/Event/MessageEvents.php",
"language": "php",
"file_size": 1524,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mime\Address;
use Symfony\Comp... | er());
}
public function testConstructorWithAddressSenderAndNonAsciiCharactersInLocalPartOfAddress()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid sender "fabièn@symfony.com": | ublic function testConstructorWithAddressSender()
{
$e = new Envelope(new Address('fabien@symfony.com'), [new Address('thomas@symfony.com')]);
$this->assertEquals(new Address('fabien@symfony.com'), $e->getSend | {
"filepath": "src/Symfony/Component/Mailer/Tests/EnvelopeTest.php",
"language": "php",
"file_size": 7196,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Twig\Mime\BodyRenderer;
use Symfony\Brid... | \Transport\AbstractTransport;
use Symfony\Component\Mailer\Transport\NullTransport;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\RawMessage;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
#[Group('time-sensitive')]
class AbstractTran | ymfony\Component\Mailer\Event\MessageEvent;
use Symfony\Component\Mailer\EventListener\MessageListener;
use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/AbstractTransportTest.php",
"language": "php",
"file_size": 4280,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Exception\InvalidArgume... | com', null, null, null, $options);
$this->assertSame('some value', $dsn->getOption('with_value'));
$this->assertSame('default', $dsn->getOption('nullable', 'default'));
$this->assertSame('default', $dsn->getOption('not_existent_pro | )
{
$this->assertEquals($dsn, Dsn::fromString($string));
}
public function testGetOption()
{
$options = ['with_value' => 'some value', 'nullable' => null];
$dsn = new Dsn('smtp', 'example. | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/DsnTest.php",
"language": "php",
"file_size": 4441,
"cut_index": 614,
"middle_length": 229
} |
nent\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer\Transport\RoundRobinTransport;
use Symfony\Component\Mailer\Transport\TransportInterface;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Message;
use Symfony\... | eturn('t1://local');
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->once())->method('__toString')->willReturn('t2://local');
$t = new RoundRobinTransport([$t1, $t2]);
$this->assertEquals('roundrobin( | tException::class);
new RoundRobinTransport([]);
}
public function testToString()
{
$t1 = $this->createMock(TransportInterface::class);
$t1->expects($this->once())->method('__toString')->willR | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/RoundRobinTransportTest.php",
"language": "php",
"file_size": 9198,
"cut_index": 921,
"middle_length": 229
} |
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\Tests\Transport\Smtp\Stream;
use PHPUnit\Framework\TestCas... | tTimeout(0.1);
$s->setPort(9999);
$s->initialize();
}
public function testSocketErrorBeforeConnectError()
{
$this->expectException(TransportException::class);
$this->expectExceptionMessageMatches('/no valid cert | stSocketErrorNoConnection()
{
$this->expectException(TransportException::class);
$this->expectExceptionMessageMatches('/Connection refused|unable to connect/i');
$s = new SocketStream();
$s->se | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/Smtp/Stream/SocketStreamTest.php",
"language": "php",
"file_size": 1364,
"cut_index": 524,
"middle_length": 229
} |
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\Tests\EventListener;
use PHPUnit\Framework\Attributes\RequiresPhpExtens... | y\Component\Mime\Part\SMimePart;
use Symfony\Component\Mime\Part\TextPart;
class SmimeSignedMessageListenerTest extends TestCase
{
#[RequiresPhpExtension('openssl')]
public function testSmimeMessageSigningProcess()
{
$signer = new SMim | er;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Crypto\SMimeSigner;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Header\MailboxListHeader;
use Symfony\Component\Mime\Message;
use Symfon | {
"filepath": "src/Symfony/Component/Mailer/Tests/EventListener/SmimeSignedMessageListenerTest.php",
"language": "php",
"file_size": 1805,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\M... |
{
#[DataProvider('fromStringProvider')]
public function testFromString(string $dsn, TransportInterface $transport)
{
$transportFactory = new Transport([new DummyTransportFactory()]);
$this->assertEquals($transport, $transportF | iler\Transport\FailoverTransport;
use Symfony\Component\Mailer\Transport\RoundRobinTransport;
use Symfony\Component\Mailer\Transport\TransportInterface;
use Symfony\Component\Mime\RawMessage;
class TransportTest extends TestCase | {
"filepath": "src/Symfony/Component/Mailer/Tests/TransportTest.php",
"language": "php",
"file_size": 4295,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\DelayedEnvelope;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Com... | KE_FAILING_SENDMAIL = __DIR__.'/Fixtures/fake-failing-sendmail.php -t';
private const FAKE_INTERACTIVE_SENDMAIL = __DIR__.'/Fixtures/fake-failing-sendmail.php -bs';
private string $argsPath;
protected function setUp(): void
{
$thi | me\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\RawMessage;
class SendmailTransportTest extends TestCase
{
private const FAKE_SENDMAIL = __DIR__.'/Fixtures/fake-sendmail.php -t';
private const FA | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/SendmailTransportTest.php",
"language": "php",
"file_size": 5929,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\EventListener;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
use Symfo... | tion testHeaders(Headers $initialHeaders, Headers $defaultHeaders, Headers $expectedHeaders, array $rules = MessageListener::DEFAULT_RULES)
{
$message = new Message($initialHeaders);
$listener = new MessageListener($defaultHeaders, null | omponent\Mime\Header\MailboxListHeader;
use Symfony\Component\Mime\Header\UnstructuredHeader;
use Symfony\Component\Mime\Message;
class MessageListenerTest extends TestCase
{
#[DataProvider('provideHeaders')]
public func | {
"filepath": "src/Symfony/Component/Mailer/Tests/EventListener/MessageListenerTest.php",
"language": "php",
"file_size": 4844,
"cut_index": 614,
"middle_length": 229
} |
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\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInt... | ate readonly ?int $cipher = null,
) {
}
public function onMessage(MessageEvent $event): void
{
$message = $event->getMessage();
if (!$message instanceof Message) {
return;
}
if (!$message->getHea | thor Elías Fernández
*/
final class SmimeEncryptedMessageListener implements EventSubscriberInterface
{
public function __construct(
private readonly SmimeCertificateRepositoryInterface $smimeRepository,
priv | {
"filepath": "src/Symfony/Component/Mailer/EventListener/SmimeEncryptedMessageListener.php",
"language": "php",
"file_size": 1875,
"cut_index": 537,
"middle_length": 229
} |
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\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Compo... | etFactory(): TransportFactoryInterface
{
return new NullTransportFactory(null, new MockHttpClient(), new NullLogger());
}
public static function supportsProvider(): iterable
{
yield [
new Dsn('null', ''),
| port;
use Symfony\Component\Mailer\Transport\NullTransportFactory;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
class NullTransportFactoryTest extends AbstractTransportFactoryTestCase
{
public function g | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/NullTransportFactoryTest.php",
"language": "php",
"file_size": 1350,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\AhaSend\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Bridge\AhaSend\Event\AhaSendDeliveryEvent;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Excep... | ionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Farhad Hedayatifard <farhad@ahasend.com>
*/
final class AhaSendApiTransport extends AbstractApiTransport
{
private | omponent\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExcept | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Transport/AhaSendApiTransport.php",
"language": "php",
"file_size": 6960,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (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\Mailtrap\Tests\Webhook;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Componen... | tion createRequestParser(): RequestParserInterface
{
return new MailtrapRequestParser(new MailtrapPayloadConverter());
}
protected function getSecret(): string
{
return 'top-secret';
}
protected function createRequ | erface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class MailtrapRequestParserTest extends AbstractRequestParserTestCase
{
protected func | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Tests/Webhook/MailtrapRequestParserTest.php",
"language": "php",
"file_size": 2434,
"cut_index": 563,
"middle_length": 229
} |
hp
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent;
$wh1 = new MailerDeliveryEvent(MailerDeliveryEvent::BOUNCE, '00000000-0000-0000-0000-000000000001', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true)[... | file_get_contents(str_replace('.php', '.json', __FILE__)), true)['events'][1]);
$wh2->setRecipientEmail('receiver@example.com');
$wh2->setTags(['Password reset']);
$wh2->setMetadata(['variable_a' => 'value', 'variable_b' => 'value2']);
$wh2->setDate(\DateT | 1] Message rejected due to local policy');
$wh1->setDate(\DateTimeImmutable::createFromFormat('U', 1726358034));
$wh2 = new MailerEngagementEvent(MailerEngagementEvent::CLICK, '00000000-0000-0000-0000-000000000002', json_decode( | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Tests/Webhook/Fixtures/batch.php",
"language": "php",
"file_size": 1072,
"cut_index": 515,
"middle_length": 229
} |
ge.
*
* (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\Mailtrap\RemoteEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent;
... | nt
{
$type = match ($payload['event']) {
'delivery' => MailerDeliveryEvent::DELIVERED,
'open' => MailerEngagementEvent::OPEN,
'click' => MailerEngagementEvent::CLICK,
'unsubscribe' => MailerEngage | se Symfony\Component\RemoteEvent\RemoteEvent;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*/
final class MailtrapPayloadConverter implements PayloadConverterInterface
{
public function convert(array $payload): RemoteEve | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/RemoteEvent/MailtrapPayloadConverter.php",
"language": "php",
"file_size": 2335,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (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\Mailtrap\Webhook;
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Co... | moteEvent;
use Symfony\Component\Webhook\Client\AbstractRequestParser;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*/
final class MailtrapRequestParser extends AbstractRequestParser
{
| Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\Mailer\Bridge\Mailtrap\RemoteEvent\MailtrapPayloadConverter;
use Symfony\Component\RemoteEvent\Exception\ParseException;
use Symfony\Component\RemoteEvent\Re | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Webhook/MailtrapRequestParser.php",
"language": "php",
"file_size": 2380,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Bridge\Sendgrid\Header\SuppressionGroupHeader;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\... | y\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author K | use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Header\DateHeader;
use Symfon | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php",
"language": "php",
"file_size": 8204,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (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\Sendgrid\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerIn... | t(#[\SensitiveParameter] string $key, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null, private ?string $region = null)
{
$host = 'smtp.sendgrid.net';
if (null !== $region && 'global' !== $region) {
| er\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;
/**
* @author Kevin Verschaeve
*/
class SendgridSmtpTransport extends EsmtpTransport
{
public function __construc | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridSmtpTransport.php",
"language": "php",
"file_size": 2416,
"cut_index": 563,
"middle_length": 229
} |
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\Sendgrid\Transport;
use Symfony\Component\Mailer\Exception\Unsup... | e();
$key = $this->getUser($dsn);
$region = $dsn->getOption('region');
if ('sendgrid+api' === $scheme) {
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
| /**
* @author Konstantin Myakshin <molodchick@gmail.com>
*/
final class SendgridTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$scheme = $dsn->getSchem | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridTransportFactory.php",
"language": "php",
"file_size": 1618,
"cut_index": 537,
"middle_length": 229
} |
ailer\Bridge\Sendgrid\Header\SuppressionGroupHeader;
use Symfony\Component\Mailer\Bridge\Sendgrid\Transport\SendgridApiTransport;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Header\MetadataHeader;
use Symfony\Component\Mailer\Header\TagHeader;
use Symfony\Component\Mime\Address;
use Symfony\Comp... | ic static function getTransportData()
{
return [
[
new SendgridApiTransport('KEY'),
'sendgrid+api://api.sendgrid.com',
],
[
new SendgridApiTransport('KEY', null | tTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(SendgridApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
publ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridApiTransportTest.php",
"language": "php",
"file_size": 13038,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (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\Sendgrid\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Frame... |
$this->assertSame($expected, (string) $transport);
}
public static function getTransportData()
{
return [
[
new SendgridSmtpTransport('KEY'),
'smtps://smtp.sendgrid.net',
| ime\Address;
use Symfony\Component\Mime\Email;
class SendgridSmtpTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(SendgridSmtpTransport $transport, string $expected)
{ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridSmtpTransportTest.php",
"language": "php",
"file_size": 2531,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Mailer\Bridge\Sendgr... | terface;
class SendgridTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new SendgridTransportFactory(null, new MockHttpClient( | ;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportFactoryIn | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridTransportFactoryTest.php",
"language": "php",
"file_size": 3311,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Tests\RemoteEvent;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Bridg... | ventName)
{
$converter = new SendgridPayloadConverter();
$event = $converter->convert([
'event' => $event,
'sg_message_id' => '123456',
'reason' => 'reason',
'timestamp' => '123456789',
| ymfony\Component\RemoteEvent\Exception\ParseException;
class SendgridPayloadConverterTest extends TestCase
{
#[DataProvider('provideDeliveryEvents')]
public function testMailDeliveryEvent(string $event, string $expectedE | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/RemoteEvent/SendgridPayloadConverterTest.php",
"language": "php",
"file_size": 4567,
"cut_index": 614,
"middle_length": 229
} |
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\Sendgrid\Tests\Webhook;
use Symfony\Component\HttpFoundation\Req... | /
class SendgridMissingSignedRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
$this->expectException(RejectWebhookException::class);
$this->expectExceptionM | ok\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
/**
* @author WoutervanderLoop.nl <info@woutervanderloop.nl>
* | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Webhook/SendgridMissingSignedRequestParserTest.php",
"language": "php",
"file_size": 1721,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Tests\Webhook;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Comp... | tractRequestParserTestCase
{
private const PRIVATE_KEY = <<<'KEY'
-----BEGIN RSA PRIVATE KEY-----
MIICWgIBAAKBgHH/ZmiTGDi6/1IIx4vOKedN24Zuxj9G0ioNpCbNssQlukWijQiz
UaOZ98JgEA11jGY1gFwCKYVSH5e1ZWN+m4hdxNQoNn8QaODzyo2ocGbobzrIuMJp
| rInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
/**
* @author WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
#[RequiresPhpExtension('openssl')]
class SendgridSignedRequestParserTest extends Abs | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Webhook/SendgridSignedRequestParserTest.php",
"language": "php",
"file_size": 3100,
"cut_index": 614,
"middle_length": 229
} |
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\Sendgrid\Tests\Webhook;
use Symfony\Component\HttpF... | bstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
return new SendgridRequestParser(new SendgridPayloadConverter());
}
/**
* @see https://github.com/sendgrid/sendgrid-php/blob/933 | mponent\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
/**
* @author WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
class SendgridUnsignedRequestParserTest extends A | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Webhook/SendgridUnsignedRequestParserTest.php",
"language": "php",
"file_size": 1324,
"cut_index": 524,
"middle_length": 229
} |
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\Sendgrid\Tests\Webhook;
use PHPUnit\Framework\Attributes\Require... | uthor WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
#[RequiresPhpExtension('openssl')]
class SendgridWrongSecretRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
| hook\SendgridRequestParser;
use Symfony\Component\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
/**
* @a | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Webhook/SendgridWrongSecretRequestParserTest.php",
"language": "php",
"file_size": 1928,
"cut_index": 537,
"middle_length": 229
} |
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\Sendgrid\Tests\Webhook;
use PHPUnit\Framework\Attributes\Require... | uthor WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
#[RequiresPhpExtension('openssl')]
class SendgridWrongSignatureRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
| hook\SendgridRequestParser;
use Symfony\Component\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
/**
* @a | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Webhook/SendgridWrongSignatureRequestParserTest.php",
"language": "php",
"file_size": 1958,
"cut_index": 537,
"middle_length": 229
} |
ent;
use Symfony\Component\RemoteEvent\Event\Mailer\MailerEngagementEvent;
$wh1 = new MailerDeliveryEvent(MailerDeliveryEvent::DROPPED, 'LRzXl_NHStOGhQ4kofSm_A.filterdrecv-p3mdw1-756b745b58-kmzbl-18-5F5FC76C-9.0', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true)[0]);
$wh1->setRecipientEmail... | OGhQ4kofSm_A.filterdrecv-p3mdw1-756b745b58-kmzbl-18-5F5FC76C-9.0', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true)[1]);
$wh2->setRecipientEmail('hello@world.com');
$wh2->setTags([]);
$wh2->setMetadata([]);
$wh2->setDate(\DateTi | ementEvent(MailerEngagementEvent::CLICK, 'LRzXl_NHSt | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Webhook/Fixtures/batch.php",
"language": "php",
"file_size": 961,
"cut_index": 582,
"middle_length": 52
} |
?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\Sendgrid\Header;
use Symfony\Component\M... | oups_to_display' => $this->groupsToDisplay,
], \JSON_THROW_ON_ERROR));
}
public function getGroupId(): int
{
return $this->groupId;
}
/**
* @return int[]
*/
public function getGroupsToDisplay(): array
| function __construct(
private int $groupId,
private array $groupsToDisplay = [],
) {
parent::__construct('X-Sendgrid-SuppressionGroup', json_encode([
'group_id' => $groupId,
'gr | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Header/SuppressionGroupHeader.php",
"language": "php",
"file_size": 1048,
"cut_index": 513,
"middle_length": 229
} |
ge.
*
* (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\Sendgrid\RemoteEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
... | convert(array $payload): AbstractMailerEvent
{
if (\in_array($payload['event'], ['processed', 'delivered', 'bounce', 'dropped', 'deferred'], true)) {
$name = match ($payload['event']) {
'processed', 'delivered' => M | tion;
use Symfony\Component\RemoteEvent\PayloadConverterInterface;
/**
* @author WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
final class SendgridPayloadConverter implements PayloadConverterInterface
{
public function | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/RemoteEvent/SendgridPayloadConverter.php",
"language": "php",
"file_size": 2413,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Webhook;
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Compone... | mponent\RemoteEvent\Exception\ParseException;
use Symfony\Component\Webhook\Client\AbstractRequestParser;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
/**
* @author WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
final class Sendgri | se Symfony\Component\Mailer\Bridge\Sendgrid\RemoteEvent\SendgridPayloadConverter;
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
use Symfony\Co | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sendgrid/Webhook/SendgridRequestParser.php",
"language": "php",
"file_size": 4282,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Postal\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use S... | rface;
use Symfony\Contracts\HttpClient\ResponseInterface;
final class PostalApiTransport extends AbstractApiTransport
{
public function __construct(
#[\SensitiveParameter] private string $apiToken,
private string $hostName,
?H | ess;
use Symfony\Component\Mime\Email;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInte | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Postal/Transport/PostalApiTransport.php",
"language": "php",
"file_size": 4996,
"cut_index": 614,
"middle_length": 229
} |
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\Postal\Transport;
use Symfony\Component\Mailer\Exce... | ->getScheme();
if (!\in_array($scheme, $this->getSupportedSchemes(), true)) {
throw new UnsupportedSchemeException($dsn, 'postal', $this->getSupportedSchemes());
}
$host = $dsn->getHost();
$port = $dsn->getPort | ransport\Dsn;
use Symfony\Component\Mailer\Transport\TransportInterface;
final class PostalTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$scheme = $dsn | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Postal/Transport/PostalTransportFactory.php",
"language": "php",
"file_size": 1479,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Postal\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockH... | #[DataProvider('getTransportData')]
public function testToString(PostalApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
public static function getTransportData(): array
{
| portException;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Part\DataPart;
use Symfony\Contracts\HttpClient\ResponseInterface;
class PostalApiTransportTest extends TestCase
{
| {
"filepath": "src/Symfony/Component/Mailer/Bridge/Postal/Tests/Transport/PostalApiTransportTest.php",
"language": "php",
"file_size": 4240,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Postal\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpC... | yTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new PostalTransportFactory(null, new MockHttpClient(), new NullLogger());
}
public s | bstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
class PostalTransportFactor | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Postal/Tests/Transport/PostalTransportFactoryTest.php",
"language": "php",
"file_size": 2671,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Infobip\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Component\Mailer\SentMessage;
u... | ce;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @see https://www.infobip.com/docs/api#channels/email/send-email
*/
final class InfobipApiTransport extends AbstractApiTransport
{
private const API_VERSION = '3';
private const HEADE | t\Mime\Part\Multipart\FormDataPart;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterfa | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Infobip/Transport/InfobipApiTransport.php",
"language": "php",
"file_size": 5922,
"cut_index": 716,
"middle_length": 229
} |
* 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\Infobip\Transport;
use Psr\EventDispatcher\EventD... | sitiveParameter] string $key, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct('smtp-api.infobip.com', 587, false, $dispatcher, $logger);
$this->setUsername('App');
$this->set | nstruct(#[\Sen | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Infobip/Transport/InfobipSmtpTransport.php",
"language": "php",
"file_size": 816,
"cut_index": 522,
"middle_length": 14
} |
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\Infobip\Transport;
use Symfony\Component\Mailer\Exception\Incomp... | ();
$apiKey = $this->getUser($dsn);
if ('infobip+api' === $schema) {
$host = $dsn->getHost();
if ('default' === $host) {
throw new IncompleteDsnException('Infobip mailer for API DSN must contain a ho | ;
use Symfony\Component\Mailer\Transport\TransportInterface;
final class InfobipTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$schema = $dsn->getScheme | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Infobip/Transport/InfobipTransportFactory.php",
"language": "php",
"file_size": 1632,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (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\Infobip\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttp... | omponent\Mailer\Transport\TransportFactoryInterface;
class InfobipApiTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new Info | ge\Infobip\Transport\InfobipTransportFactory;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\C | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Infobip/Tests/Transport/InfobipApiTransportFactoryTest.php",
"language": "php",
"file_size": 3038,
"cut_index": 563,
"middle_length": 229
} |
xtends TestCase
{
protected const KEY = 'k3y';
private MockResponse $response;
private MockHttpClient $httpClient;
private InfobipApiTransport $transport;
protected function setUp(): void
{
$this->response = new MockResponse('{}');
$this->httpClient = new class(fn () => $this->... | eof \Generator) {
$body = '';
foreach ($options['body'] as $data) {
$body .= $data;
}
$options['body'] = $body;
}
retur | this method override is to record the request body as a string
// It's impossible to get the generated body when using a generator as a body
if (isset($options['body']) && $options['body'] instanc | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Infobip/Tests/Transport/InfobipApiTransportTest.php",
"language": "php",
"file_size": 18660,
"cut_index": 1331,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Brevo\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Component\Mailer\Header\MetadataH... | ony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Pierre TANGUY
*/
final class BrevoApiTransport extends AbstractApiTransport
{
public function __construct(
#[\SensitiveParameter] |
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symf | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoApiTransport.php",
"language": "php",
"file_size": 6419,
"cut_index": 716,
"middle_length": 229
} |
ackage.
*
* (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\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerI... | sword, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct('smtp-relay.brevo.com', 465, true, $dispatcher, $logger);
$this->setUsername($username);
$this->setPassword($password); | string $username, #[\SensitiveParameter] string $pas | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoSmtpTransport.php",
"language": "php",
"file_size": 876,
"cut_index": 559,
"middle_length": 52
} |
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\Transport;
use Symfony\Component\Mailer\Exception\Unsuppor... | s(), true)) {
throw new UnsupportedSchemeException($dsn, 'brevo', $this->getSupportedSchemes());
}
switch ($dsn->getScheme()) {
default:
case 'brevo':
case 'brevo+smtp':
$tran |
* @author Pierre TANGUY
*/
final class BrevoTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
if (!\in_array($dsn->getScheme(), $this->getSupportedScheme | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoTransportFactory.php",
"language": "php",
"file_size": 1629,
"cut_index": 537,
"middle_length": 229
} |
entDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mailer\Bridge\AhaSend\Event\AhaSendDeliveryEvent;
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendApiTransport;
use Symfony\Component\Ma... | ssertSame($expected, (string) $transport);
}
public static function getTransportData()
{
return [
[
new AhaSendApiTransport('KEY'),
'ahasend+api://send.ahasend.com',
],
| cts\HttpClient\ResponseInterface;
class AhaSendApiTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(AhaSendApiTransport $transport, string $expected)
{
$this->a | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Tests/Transport/AhaSendApiTransportTest.php",
"language": "php",
"file_size": 12648,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\AhaSend\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Mailer\Bridge\AhaSend... | ;
class AhaSendTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new AhaSendTransportFactory(null, new MockHttpClient(), new Nu | ymfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Tests/Transport/AhaSendTransportFactoryTest.php",
"language": "php",
"file_size": 3251,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\AhaSend\RemoteEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
u... | array($payload['type'], ['message.clicked', 'message.opened'], true)) {
$name = match ($payload['type']) {
'message.clicked' => MailerEngagementEvent::CLICK,
'message.opened' => MailerEngagementEvent::OPEN,
| ion;
use Symfony\Component\RemoteEvent\PayloadConverterInterface;
final class AhaSendPayloadConverter implements PayloadConverterInterface
{
public function convert(array $payload): AbstractMailerEvent
{
if (\in_ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/RemoteEvent/AhaSendPayloadConverter.php",
"language": "php",
"file_size": 2805,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (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\AhaSend\Webhook;
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Com... | nt\Exception\ParseException;
use Symfony\Component\Webhook\Client\AbstractRequestParser;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
final class AhaSendRequestParser extends AbstractRequestParser
{
public function __construct(
| omponent\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\Mailer\Bridge\AhaSend\RemoteEvent\AhaSendPayloadConverter;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
use Symfony\Component\RemoteEve | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Webhook/AhaSendRequestParser.php",
"language": "php",
"file_size": 3013,
"cut_index": 563,
"middle_length": 229
} |
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\Resend\Transport;
use Symfony\Component\Mailer\Exce... | h ($dsn->getScheme()) {
'resend', 'resend+smtp' => new ResendSmtpTransport($this->getPassword($dsn), $this->dispatcher, $this->logger),
'resend+api' => (new ResendApiTransport($this->getUser($dsn), $this->client, $this->dispatcher, | nterface;
/**
* @author Mathieu Santostefano <msantostefano@proton.me>
*/
final class ResendTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
return matc | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Transport/ResendTransportFactory.php",
"language": "php",
"file_size": 1398,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Resend\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mailer\Br... | piTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(ResendApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
public static function | er;
use Symfony\Component\Mailer\Header\TagHeader;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Part\DataPart;
use Symfony\Contracts\HttpClient\ResponseInterface;
class ResendA | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Tests/Transport/ResendApiTransportTest.php",
"language": "php",
"file_size": 7177,
"cut_index": 716,
"middle_length": 229
} |
Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent;
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::RECEIVED, '172c41ce-ba6d-4281-8a7a-541faa725748', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('test@example.com');
$wh->setTags([]);
$wh->setMeta... |
'value' => 'test@resend.com',
],
],
'subject' => 'Test subject',
'to' => [
'test@example.com',
],
]);
$wh->setReason('');
$wh->setDate(\DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', '2024-04-08T09:43:09 | ' => 'Sender', | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Tests/Webhook/Fixtures/sent.php",
"language": "php",
"file_size": 818,
"cut_index": 522,
"middle_length": 14
} |
ge.
*
* (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\Resend\RemoteEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
us... | ray($payload['type'], ['email.sent', 'email.delivered', 'email.delivery_delayed', 'email.bounced'], true)) {
$name = match ($payload['type']) {
'email.sent' => MailerDeliveryEvent::RECEIVED,
'email.delivered' => | on;
use Symfony\Component\RemoteEvent\PayloadConverterInterface;
final class ResendPayloadConverter implements PayloadConverterInterface
{
public function convert(array $payload): AbstractMailerEvent
{
if (\in_ar | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/RemoteEvent/ResendPayloadConverter.php",
"language": "php",
"file_size": 2210,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MicrosoftGraph\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Bridge\MicrosoftGraph\TokenManager;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Excep... | AbstractApiTransport
{
private const USER_ENDPOINT = '%s/v1.0/users/%s/sendMail';
/**
* @param string $graphEndpoint Graph API URL to which to POST emails
* @param bool $noSave Whether the skip saving the send message in the Se | me\Email;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
class MicrosoftGraphApiTransport extends | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Transport/MicrosoftGraphApiTransport.php",
"language": "php",
"file_size": 6773,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MicrosoftGraph\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Clock\Clock;
use Symfony\Component\Clock\MockClock;
use Symfony\C... |
$client = new MockHttpClient(function (string $method, string $url, array $options): ResponseInterface {
$this->assertSame('POST', $method);
$this->assertSame('https://auth/tenant/oauth2/v2.0/token', $url);
par | osoftGraph\TokenManager;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Contracts\HttpClient\ResponseInterface;
class TokenManagerTest extends TestCase
{
public function testTokenRetrieved()
{ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Tests/TokenManagerTest.php",
"language": "php",
"file_size": 3385,
"cut_index": 614,
"middle_length": 229
} |
nent\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Mailer\Bridge\MicrosoftGraph\Tests\TokenManagerMock;
use Symfony\Component\Mailer\Bridge\MicrosoftGraph\Transport\MicrosoftGraphApiTransport;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use S... | : array
{
return [
[
new MicrosoftGraphApiTransport('graph.ms.com', new TokenManagerMock(), false),
'microsoftgraph+api://graph.ms.com',
],
];
}
public function testSend() | ('getTransportData')]
public function testToString(MicrosoftGraphApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
public static function getTransportData() | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Tests/Transport/MicrosoftGraphApiTransportTest.php",
"language": "php",
"file_size": 13172,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Mailtrap\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Component\Mailer\Exception\Tra... | Interface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*/
final class MailtrapApiTransport extends AbstractApiTransport
{
private const LIVE | port\AbstractApiTransport;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportException | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php",
"language": "php",
"file_size": 5925,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Mailtrap\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mailer\... | terface;
class MailtrapApiTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(MailtrapApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
| nsportException;
use Symfony\Component\Mailer\Header\MetadataHeader;
use Symfony\Component\Mailer\Header\TagHeader;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Contracts\HttpClient\ResponseIn | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Tests/Transport/MailtrapApiTransportTest.php",
"language": "php",
"file_size": 7675,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Mailtrap\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Mailer\Bridge\Mailtr... | terface;
class MailtrapTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new MailtrapTransportFactory(null, new MockHttpClient( | ;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportFactoryIn | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Tests/Transport/MailtrapTransportFactoryTest.php",
"language": "php",
"file_size": 3709,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Sweego\RemoteEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
us... | ray($payload['event_type'], ['email_sent', 'delivered', 'soft-bounce', 'hard_bounce'], true)) {
$name = match ($payload['event_type']) {
'email_sent' => MailerDeliveryEvent::RECEIVED,
'delivered' => MailerDeliver | on;
use Symfony\Component\RemoteEvent\PayloadConverterInterface;
final class SweegoPayloadConverter implements PayloadConverterInterface
{
public function convert(array $payload): AbstractMailerEvent
{
if (\in_ar | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/RemoteEvent/SweegoPayloadConverter.php",
"language": "php",
"file_size": 2209,
"cut_index": 563,
"middle_length": 229
} |
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\AhaSend\Transport;
use Symfony\Component\Mailer\Exception\Unsupp... | scheme = $dsn->getScheme();
$user = $this->getUser($dsn);
if ('ahasend+api' === $scheme) {
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
$transport = (new AhaS | **
* @author Farhad Hedayatifard <farhad@ahasend.com>
*/
final class AhaSendTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$transport = null;
$ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Transport/AhaSendTransportFactory.php",
"language": "php",
"file_size": 1672,
"cut_index": 537,
"middle_length": 229
} |
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\AhaSend\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Sym... | d = new \ReflectionMethod(AhaSendSmtpTransport::class, 'addAhaSendHeaders');
$method->invoke($transport, $email);
$this->assertCount(1, $email->getHeaders()->toArray());
$this->assertSame('foo: bar', $email->getHeaders()->get('FOO' | stCase
{
public function testCustomHeader()
{
$email = new Email();
$email->getHeaders()->addTextHeader('foo', 'bar');
$transport = new AhaSendSmtpTransport('USERNAME', 'PASSWORD');
$metho | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Tests/Transport/AhaSendSmtpTransportTest.php",
"language": "php",
"file_size": 1603,
"cut_index": 537,
"middle_length": 229
} |
he 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\Resend\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Ps... | nsitiveParameter] string $password, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct('smtp.resend.com', 465, true, $dispatcher, $logger);
$this->setUsername('resend');
$this-> | mtpTransport
{
public function __construct(#[\Se | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Transport/ResendSmtpTransport.php",
"language": "php",
"file_size": 887,
"cut_index": 547,
"middle_length": 52
} |
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\Resend\Tests\Webhook;
use Symfony\Component\HttpFou... | rserInterface
{
return new ResendRequestParser(new ResendPayloadConverter());
}
protected function getSecret(): string
{
return 'whsec_ESwTAuuIe3yfH4DgdgI+ENsiNzPAGdp+';
}
protected function createRequest(string $p | bhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class ResendRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestPa | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Tests/Webhook/ResendRequestParserTest.php",
"language": "php",
"file_size": 1406,
"cut_index": 524,
"middle_length": 229
} |
ge.
*
* (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\MicrosoftGraph;
use Symfony\Component\Clock\DatePoint;
use Symfony\Component\Mailer\Except... | tId Microsoft Azure tenant identifier
* @param string $appId Microsoft Azure app registration ID
* @param string $appSecret Microsoft Azure app registration secret
*/
public function __construct(
private readonly | ing $token = null;
private ?DatePoint $tokenExpires = null;
/**
* @param string $graphEndpoint Graph API URL to which to POST emails
* @param string $authEndpoint Authentication URL
* @param string $tenan | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/TokenManager.php",
"language": "php",
"file_size": 2596,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MicrosoftGraph\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockH... | est\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
class MicrosoftGraphTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
| r\Bridge\MicrosoftGraph\Transport\MicrosoftGraphTransportFactory;
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\T | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Tests/Transport/MicrosoftGraphTransportFactoryTest.php",
"language": "php",
"file_size": 4392,
"cut_index": 614,
"middle_length": 229
} |
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\Mailtrap\Transport;
use Symfony\Component\Mailer\Exception\Unsup... | $user = $this->getUser($dsn);
if ('mailtrap+api' === $scheme || 'mailtrap+sandbox' === $scheme) {
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
$inboxId = 'mailtrap+ | /**
* @author Kevin Bond <kevinbond@gmail.com>
*/
final class MailtrapTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$scheme = $dsn->getScheme();
| {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapTransportFactory.php",
"language": "php",
"file_size": 1703,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sweego\Webhook;
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component... | \Component\RemoteEvent\Exception\ParseException;
use Symfony\Component\Webhook\Client\AbstractRequestParser;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
final class SweegoRequestParser extends AbstractRequestParser
{
public functio | Matcher;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\Mailer\Bridge\Sweego\RemoteEvent\SweegoPayloadConverter;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
use Symfony | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Webhook/SweegoRequestParser.php",
"language": "php",
"file_size": 3262,
"cut_index": 614,
"middle_length": 229
} |
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\AhaSend\Tests\Webhook;
use Symfony\Component\HttpFoundation\Requ... | L%Ud&:jhpAW1gLaR%AEFwfKnwp60cC';
protected function createRequestParser(): RequestParserInterface
{
return new AhaSendRequestParser(new AhaSendPayloadConverter());
}
protected function createRequest(string $payload): Request
{ | ient\RequestParserInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class AhaSendRequestParserTest extends AbstractRequestParserTestCase
{
private const SECRET = 'nxLe:L:fZLb7J_Wb3uFeWX/&z4Ed#9&DxP | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Tests/Webhook/AhaSendRequestParserTest.php",
"language": "php",
"file_size": 1855,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Resend\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Component\Mailer\Exception\Inval... | face;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Mathieu Santostefano <msantostefano@proton.me>
*/
final class ResendApiTransport extends AbstractApiTransport
{
public func | \Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInter | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Transport/ResendApiTransport.php",
"language": "php",
"file_size": 5985,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Resend\Webhook;
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Component\HttpFoundation\HeaderBag;
use Symfony\Compone... | ception\InvalidArgumentException;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
use Symfony\Component\RemoteEvent\Exception\ParseException;
use Symfony\Component\Webhook\Client\AbstractRequestParser;
use Symfony\Component\Webhook\Exce | nent\HttpFoundation\RequestMatcher\MethodRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\Mailer\Bridge\Resend\RemoteEvent\ResendPayloadConverter;
use Symfony\Component\Mailer\Ex | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Webhook/ResendRequestParser.php",
"language": "php",
"file_size": 4492,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Mailtrap\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerIn... | gmail.com>
*/
final class MailtrapSmtpTransport extends EsmtpTransport
{
public function __construct(#[\SensitiveParameter] string $password, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__constr | er\TagHeader;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;
/**
* @author Kevin Bond <kevinbond@ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapSmtpTransport.php",
"language": "php",
"file_size": 2384,
"cut_index": 563,
"middle_length": 229
} |
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\AhaSend\Transport;
use Psr\EventDispatcher\EventDispatcherInterf... | function __construct(#[\SensitiveParameter] string $username, #[\SensitiveParameter] string $password, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct('send.ahasend.com', 587, false, $dispatc | ransport\Smtp\EsmtpTransport;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;
/**
* @author Farhad Hedayatifard <farhad@ahasend.com>
*/
class AhaSendSmtpTransport extends EsmtpTransport
{
public | {
"filepath": "src/Symfony/Component/Mailer/Bridge/AhaSend/Transport/AhaSendSmtpTransport.php",
"language": "php",
"file_size": 1865,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (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\MicrosoftGraph\Transport;
use Symfony\Component\Mailer\Bridge\MicrosoftGraph\TokenManager;... | nsportFactory
{
public function create(Dsn $dsn): TransportInterface
{
if ('microsoftgraph+api' !== $dsn->getScheme()) {
throw new UnsupportedSchemeException($dsn, 'microsoft graph api', $this->getSupportedSchemes());
}
| on;
use Symfony\Component\Mailer\Transport\AbstractTransportFactory;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportInterface;
class MicrosoftGraphTransportFactory extends AbstractTra | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Transport/MicrosoftGraphTransportFactory.php",
"language": "php",
"file_size": 2539,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (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\Resend\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpC... | t\Mailer\Transport\TransportFactoryInterface;
class ResendTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new ResendTransport | send\Transport\ResendTransportFactory;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Componen | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Resend/Tests/Transport/ResendTransportFactoryTest.php",
"language": "php",
"file_size": 2841,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (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\Mailtrap\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Bri... | );
$transport = new MailtrapSmtpTransport('ACCESS_KEY');
$method = new \ReflectionMethod(MailtrapSmtpTransport::class, 'addMailtrapHeaders');
$method->invoke($transport, $email);
$this->assertCount(1, $email->getHeaders()- | \TagHeader;
use Symfony\Component\Mime\Email;
class MailtrapSmtpTransportTest extends TestCase
{
public function testCustomHeader()
{
$email = new Email();
$email->getHeaders()->addTextHeader('foo', 'bar' | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailtrap/Tests/Transport/MailtrapSmtpTransportTest.php",
"language": "php",
"file_size": 2608,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Brevo\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mailer\Bri... | se Symfony\Contracts\HttpClient\ResponseInterface;
class BrevoApiTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(BrevoApiTransport $transport, string $expected)
{
$this->assertSame($exp | eptionInterface;
use Symfony\Component\Mailer\Header\MetadataHeader;
use Symfony\Component\Mailer\Header\TagHeader;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Part\DataPart;
u | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Brevo/Tests/Transport/BrevoApiTransportTest.php",
"language": "php",
"file_size": 7307,
"cut_index": 716,
"middle_length": 229
} |
<?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\Mailgun\Transport;
use Psr\EventDispatc... | er = null)
{
parent::__construct('us' !== ($region ?: 'us') ? \sprintf('smtp.%s.mailgun.org', $region) : 'smtp.mailgun.org', 587, false, $dispatcher, $logger);
$this->setUsername($username);
$this->setPassword($password);
} | smtpTransport
{
use MailgunHeadersTrait;
public function __construct(string $username, #[\SensitiveParameter] string $password, ?string $region = null, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logg | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunSmtpTransport.php",
"language": "php",
"file_size": 1000,
"cut_index": 512,
"middle_length": 229
} |
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\Mailgun\Transport;
use Symfony\Component\Mailer\Exception\Unsupp... | );
$user = $this->getUser($dsn);
$password = $this->getPassword($dsn);
$region = $dsn->getOption('region');
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
if ('mailg | **
* @author Konstantin Myakshin <molodchick@gmail.com>
*/
final class MailgunTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$scheme = $dsn->getScheme( | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunTransportFactory.php",
"language": "php",
"file_size": 1893,
"cut_index": 537,
"middle_length": 229
} |
tpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunApiTransport;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
us... | me($expected, (string) $transport);
}
public static function getTransportData()
{
return [
[
new MailgunApiTransport('ACCESS_KEY', 'DOMAIN'),
'mailgun+api://api.mailgun.net?domain=DOMAIN',
| pClient\ResponseInterface;
class MailgunApiTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public function testToString(MailgunApiTransport $transport, string $expected)
{
$this->assertSa | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Mailgun/Tests/Transport/MailgunApiTransportTest.php",
"language": "php",
"file_size": 12626,
"cut_index": 921,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.