Fix template lookup column name in send-notification
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 <noreply@anthropic.com>
This commit is contained in:
@@ -215,7 +215,7 @@ serve(async (req: Request): Promise<Response> => {
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user