chore: initial import for test contour
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Mail;
|
||||
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
final class SendMailService
|
||||
{
|
||||
public function __construct(
|
||||
private MailerInterface $mailer,
|
||||
private string $fromEmail = 'noreply@sova.clinic',
|
||||
private string $fromName = 'Sova Clinic'
|
||||
) {
|
||||
}
|
||||
|
||||
public function send(string $mailto, string $subject, string $message): void
|
||||
{
|
||||
$email = (new Email())
|
||||
->from(sprintf('%s <%s>', $this->fromName, $this->fromEmail))
|
||||
->to($mailto)
|
||||
->subject($subject)
|
||||
->text($message);
|
||||
|
||||
$this->mailer->send($email);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user