Decision now support auto mailing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user