diff --git a/supabase/functions/send-notification/index.ts b/supabase/functions/send-notification/index.ts index ad83067..ef217ed 100644 --- a/supabase/functions/send-notification/index.ts +++ b/supabase/functions/send-notification/index.ts @@ -265,8 +265,8 @@ serve(async (req: Request): Promise => { } } - const subject = replaceVariables(template.subject, allVariables); - const htmlContent = replaceVariables(template.body_html || template.body_text || "", allVariables); + const subject = replaceVariables(template.email_subject || template.subject || "", allVariables); + const htmlContent = replaceVariables(template.email_body_html || template.body_html || template.body_text || "", allVariables); // Wrap with master template for consistent branding const htmlBody = EmailTemplateRenderer.render({ diff --git a/supabase/migrations/20250103000001_update_order_created_template_with_qr.sql b/supabase/migrations/20250103000001_update_order_created_template_with_qr.sql index 6b8a8fe..393e626 100644 --- a/supabase/migrations/20250103000001_update_order_created_template_with_qr.sql +++ b/supabase/migrations/20250103000001_update_order_created_template_with_qr.sql @@ -3,7 +3,8 @@ UPDATE notification_templates SET - body_html = ' + email_subject = 'Konfirmasi Pesanan - Order #{order_id}', + email_body_html = '

Konfirmasi Pesanan

@@ -78,9 +79,9 @@ WHERE key = 'order_created'; -- Verify the update SELECT key, - subject, + email_subject, is_active, - LEFT(body_html, 100) as body_preview, + LEFT(email_body_html, 100) as body_preview, updated_at FROM notification_templates WHERE key = 'order_created';