diff --git a/app/Helpers/NotificationHelper.php b/app/Helpers/NotificationHelper.php index e6f817ed8..33d441fa8 100644 --- a/app/Helpers/NotificationHelper.php +++ b/app/Helpers/NotificationHelper.php @@ -31,6 +31,13 @@ class NotificationHelper if (!$emailTemplate || !$emailTemplate->enabled || config('settings.mail_disable')) { return; } + + // Ensure the email template has a body - skip if null/empty + if (empty($emailTemplate->body)) { + \Log::warning("Email template '{$emailTemplateKey}' has no body content, skipping email to {$user->email}"); + return; + } + $mail = new Mail($emailTemplate, $data); $emailLog = EmailLog::create([