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:
24
src/Mail/SendmailDriver.php
Normal file
24
src/Mail/SendmailDriver.php
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user