mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 10:14:16 +08:00
Remove Mandrill mail driver
This is in preparation for the upcoming upgrade to Laravel 6, which dropped this driver. Refs #2055.
This commit is contained in:
parent
a6cb962f97
commit
2b76b169d3
|
@ -24,7 +24,6 @@ class MailServiceProvider extends AbstractServiceProvider
|
|||
return [
|
||||
'mail' => SendmailDriver::class,
|
||||
'mailgun' => MailgunDriver::class,
|
||||
'mandrill' => MandrillDriver::class,
|
||||
'log' => LogDriver::class,
|
||||
'smtp' => SmtpDriver::class,
|
||||
];
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Mail;
|
||||
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Validation\Factory;
|
||||
use Illuminate\Mail\Transport\MandrillTransport;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Swift_Transport;
|
||||
|
||||
class MandrillDriver implements DriverInterface
|
||||
{
|
||||
public function availableSettings(): array
|
||||
{
|
||||
return [
|
||||
'mail_mandrill_secret' => '',
|
||||
];
|
||||
}
|
||||
|
||||
public function validate(SettingsRepositoryInterface $settings, Factory $validator): MessageBag
|
||||
{
|
||||
return $validator->make($settings->all(), [
|
||||
'mail_mandrill_secret' => 'required',
|
||||
])->errors();
|
||||
}
|
||||
|
||||
public function canSend(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function buildTransport(SettingsRepositoryInterface $settings): Swift_Transport
|
||||
{
|
||||
return new MandrillTransport(
|
||||
new Client(['connect_timeout' => 60]),
|
||||
$settings->get('mail_mandrill_secret')
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user