From 00de020b6c5f092d280d90620b84d62ae8edc021 Mon Sep 17 00:00:00 2001 From: dwindown Date: Sat, 3 Jan 2026 08:52:32 +0700 Subject: [PATCH] Fix template lookup column name in send-notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function was using .eq("template_key") but the actual column name in notification_templates table is "key". This caused "Template not found" errors even when the template existed and was active. Changes: - send-notification/index.ts: Changed .eq("template_key") to .eq("key") - Matches the pattern used in send-auth-otp and other edge functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- supabase/functions/send-notification/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase/functions/send-notification/index.ts b/supabase/functions/send-notification/index.ts index b36f1ce..ad83067 100644 --- a/supabase/functions/send-notification/index.ts +++ b/supabase/functions/send-notification/index.ts @@ -215,7 +215,7 @@ serve(async (req: Request): Promise => { const { data: template, error: templateError } = await supabase .from("notification_templates") .select("*") - .eq("template_key", template_key) + .eq("key", template_key) .eq("is_active", true) .single();