NullProvider example

$this->assertSame('aws-source-arn', $content['FromEmailAddressIdentityArn']);
            $this->assertSame('bounces@example.com', $content['FeedbackForwardingEmailAddress']);
            $this->assertSame([['Name' => 'tagName1', 'Value' => 'tag Value1']['Name' => 'tagName2', 'Value' => 'tag Value2']]$content['EmailTags']);

            $json = '{"MessageId": "foobar"}';

            return new MockResponse($json[
                'http_code' => 200,
            ]);
        });

        $transport = new SesApiAsyncAwsTransport(new SesClient(Configuration::create([])new NullProvider()$client));

        $mail = new Email();
        $mail->subject('Hello!')
            ->to(new Address('saif.gmati@symfony.com', 'Saif Eddin'))
            ->cc(new Address('jeremy@derusse.com', 'Jérémy'))
            ->from(new Address('fabpot@symfony.com', 'Fabién'))
            ->text('Hello There!')
            ->html('<b>Hello There!</b>')
            ->replyTo(new Address('replyto-1@example.com')new Address('replyto-2@example.com'))
            ->returnPath(new Address('bounces@example.com'));

        
use Symfony\Component\Translation\Exception\UnsupportedSchemeException;

/** * @author Mathieu Santostefano <msantostefano@protonmail.com> */
final class NullProviderFactory extends AbstractProviderFactory
{
    public function create(Dsn $dsn): ProviderInterface
    {
        if ('null' === $dsn->getScheme()) {
            return new NullProvider();
        }

        throw new UnsupportedSchemeException($dsn, 'null', $this->getSupportedSchemes());
    }

    protected function getSupportedSchemes(): array
    {
        return ['null'];
    }
}
$this->assertSame('aws-configuration-set-name', $body['ConfigurationSetName']);
            $this->assertSame('aws-source-arn', $body['FromEmailAddressIdentityArn']);
            $this->assertSame([['Name' => 'tagName1', 'Value' => 'tag Value1']['Name' => 'tagName2', 'Value' => 'tag Value2']]$body['EmailTags']);

            $json = '{"MessageId": "foobar"}';

            return new MockResponse($json[
                'http_code' => 200,
            ]);
        });

        $transport = new SesHttpAsyncAwsTransport(new SesClient(Configuration::create([])new NullProvider()$client));

        $mail = new Email();
        $mail->subject('Hello!')
            ->to(new Address('saif.gmati@symfony.com', 'Saif Eddin'))
            ->from(new Address('fabpot@symfony.com', 'Fabien'))
            ->text('Hello There!');

        $mail->getHeaders()->addTextHeader('X-SES-CONFIGURATION-SET', 'aws-configuration-set-name');
        $mail->getHeaders()->addTextHeader('X-SES-SOURCE-ARN', 'aws-source-arn');
        $mail->getHeaders()->add(new MetadataHeader('tagName1', 'tag Value1'));
        $mail->getHeaders()->add(new MetadataHeader('tagName2', 'tag Value2'));

        
Home | Imprint | This part of the site doesn't use cookies.