1
0
mirror of https://github.com/flarum/core.git synced 2025-08-10 02:17:37 +02:00

Implement mail driver classes (#1169)

This adds an interface for mail drivers to implement, defining several
methods that we need throughout Flarum to configure, validate and use
the various email drivers we can support through Laravel.

More mail drivers can be added by `extend()`ing the container binding
"mail.supported_drivers" with an arbitrary key and the name of a class
that implements our new `DriverInterface`.

This will ensure that drivers added by extensions can be properly built
and validated, even in the frontend.
This commit is contained in:
Franz Liedke
2019-03-13 21:21:36 +01:00
parent 9910e884fc
commit 46acfb6c23
7 changed files with 188 additions and 87 deletions

View File

@@ -0,0 +1,24 @@
<?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 Flarum\Settings\SettingsRepositoryInterface;
use Swift_SendmailTransport;
use Swift_Transport;
class SendmailDriver implements DriverInterface
{
public function buildTransport(SettingsRepositoryInterface $settings): Swift_Transport
{
return new Swift_SendmailTransport;
}
}