add Emailer and EmailFactory interfaces with laravel + fake impls
This commit is contained in:
parent
e16cb45387
commit
2890781a56
6 changed files with 104 additions and 0 deletions
25
backend/app/Email/LaravelMailer.php
Normal file
25
backend/app/Email/LaravelMailer.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Email;
|
||||
|
||||
use Illuminate\Contracts\Mail\Mailer;
|
||||
use Illuminate\Mail\Message;
|
||||
|
||||
class LaravelMailer implements Emailer
|
||||
{
|
||||
public function __construct(
|
||||
private Mailer $mailer,
|
||||
) {}
|
||||
|
||||
public function send(string $from, string $to, string $body): void
|
||||
{
|
||||
$this->mailer->raw(
|
||||
$body,
|
||||
function (Message $message) use ($from, $to) {
|
||||
$message->from($from)
|
||||
->to($to)
|
||||
->subject('TIDE');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue