Fix email unconfirmed login flow with OTP resend and update email API field names

This commit is contained in:
dwindown
2026-01-02 19:33:51 +07:00
parent 8f46c5cfd9
commit eee6339074
13 changed files with 668 additions and 65 deletions

View File

@@ -1,5 +1,6 @@
import { serve } from "https://deno.land/std@0.190.0/http/server.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";
import { EmailTemplateRenderer } from "../shared/email-template-renderer.ts";
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@@ -246,7 +247,14 @@ serve(async (req: Request): Promise<Response> => {
};
const subject = replaceVariables(template.subject, allVariables);
const htmlBody = replaceVariables(template.body_html || template.body_text || "", allVariables);
const htmlContent = replaceVariables(template.body_html || template.body_text || "", allVariables);
// Wrap with master template for consistent branding
const htmlBody = EmailTemplateRenderer.render({
subject: subject,
content: htmlContent,
brandName: settings.brand_name || "ACCESS HUB",
});
const emailPayload: EmailPayload = {
to: recipient_email,