mirror of
https://github.com/flarum/core.git
synced 2025-07-28 20:20:34 +02:00
This includes an API endpoint for fetching the list of possible drivers and their configuration fields. In the future, this can be extended to include more meta information about each field.
45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Mail;
|
|
|
|
use Aws\Ses\SesClient;
|
|
use Flarum\Settings\SettingsRepositoryInterface;
|
|
use Illuminate\Mail\Transport\SesTransport;
|
|
use Swift_Transport;
|
|
|
|
class SesDriver implements DriverInterface
|
|
{
|
|
public function availableSettings(): array
|
|
{
|
|
return [
|
|
'mail_ses_key',
|
|
'mail_ses_secret',
|
|
'mail_ses_region',
|
|
];
|
|
}
|
|
|
|
public function buildTransport(SettingsRepositoryInterface $settings): Swift_Transport
|
|
{
|
|
$config = [
|
|
'version' => 'latest',
|
|
'service' => 'email',
|
|
'region' => $settings->get('mail_ses_region'),
|
|
'credentials' => [
|
|
'key' => $settings->get('mail_ses_key'),
|
|
'secret' => $settings->get('mail_ses_secret'),
|
|
],
|
|
];
|
|
|
|
return new SesTransport(new SesClient($config));
|
|
}
|
|
}
|