Decision now support auto mailing

This commit is contained in:
Simon Pocrnjič
2025-10-12 00:20:03 +02:00
parent 1b615163be
commit 3ab1c05fcc
33 changed files with 1862 additions and 548 deletions
@@ -126,14 +126,15 @@ public function sendTest(Request $request, MailProfile $mailProfile)
$mailer = new SymfonyMailer($transport);
$fromAddr = $mailProfile->from_address ?: $username;
$fromName = $mailProfile->from_name ?: config('app.name');
$fromName = (string) ($mailProfile->from_name ?: (config('mail.from.name') ?? config('app.name') ?? ''));
$html = '<p>This is a <strong>test email</strong> from profile <code>'.e($mailProfile->name).'</code> at '.e(now()->toDateTimeString()).'.</p>';
$text = 'This is a test email from profile "'.$mailProfile->name.'" at '.now()->toDateTimeString().'.';
// Build email
$fromAddress = $fromName !== '' ? new Address($fromAddr, $fromName) : new Address($fromAddr);
$email = (new Email)
->from(new Address($fromAddr, $fromName))
->from($fromAddress)
->to($to)
->subject('Test email - '.$mailProfile->name)
->text($text)