diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e0f56e6f6a3f..175b476b6b90 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -143,6 +143,9 @@ jobs: - name: Execute tests run: vendor/bin/phpunit --verbose + env: + AWS_ACCESS_KEY_ID: random_key + AWS_SECRET_ACCESS_KEY: random_secret - name: Store artifacts uses: actions/upload-artifact@v2 diff --git a/composer.json b/composer.json index 91c2d3aa6185..bd44721a7f1b 100644 --- a/composer.json +++ b/composer.json @@ -92,6 +92,7 @@ "phpstan/phpstan": "^1.0", "predis/predis": "^1.1.9", "phpunit/phpunit": "^9.5.8", + "symfony/amazon-mailer": "^6.0", "symfony/cache": "^6.0" }, "provide": { diff --git a/src/Illuminate/Mail/MailManager.php b/src/Illuminate/Mail/MailManager.php index 5b546738365d..b7b0fc7908b4 100644 --- a/src/Illuminate/Mail/MailManager.php +++ b/src/Illuminate/Mail/MailManager.php @@ -243,8 +243,8 @@ protected function createSesTransport(array $config) return $factory->create(new Dsn( 'ses+api', 'default', - $config['key'], - $config['secret'], + $config['key'] ?? null, + $config['secret'] ?? null, $config['port'] ?? null, $config )); diff --git a/tests/Mail/MailSesTransportTest.php b/tests/Mail/MailSesTransportTest.php new file mode 100755 index 000000000000..306038cc4514 --- /dev/null +++ b/tests/Mail/MailSesTransportTest.php @@ -0,0 +1,30 @@ +singleton('config', function () { + return new Repository([ + 'services.ses' => [ + 'region' => 'us-east-1', + ], + ]); + }); + + $manager = new MailManager($container); + + $transport = $manager->createSymfonyTransport(['transport' => 'ses']); + + $this->assertSame('ses+api://random_key@us-east-1', $transport->__toString()); + } +}