From 259a905ea51c790605ab54336d569b0dabb3ca62 Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Sun, 25 Jan 2026 15:10:11 -0500 Subject: [PATCH] fix: prevent mail errors when email template body is null --- app/Helpers/NotificationHelper.php | 7 +++++++ 1 file changed, 7 insertions(+) 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([