Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Learn how to send your first email using Supabase Edge Functions.
Create Supabase function
supabase functions new resend
Edit the handler function
index.ts
const RESEND_API_KEY = Deno.env.get('RESEND_API_KEY'); const handler = async (_request: Request): Promise<Response> => { const res = await fetch('https://api.resend.com/emails', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${RESEND_API_KEY}`, }, body: JSON.stringify({ from: 'Acme <onboarding@resend.dev>', to: ['delivered@resend.dev'], subject: 'hello world', html: '<strong>it works!</strong>', }), }); const data = await res.json(); return new Response(JSON.stringify(data), { status: 200, headers: { 'Content-Type': 'application/json', }, }); }; Deno.serve(handler);
Deploy and send email
supabase functions start supabase functions serve resend --no-verify-jwt
supabase functions deploy resend
Was this page helpful?