Refactor: Use NTFY_URL env var instead of constructing from NTFY_TOPIC

This commit is contained in:
2025-12-15 19:23:22 -08:00
parent 2b9ef5a5c4
commit 6d2165caf7

View File

@@ -17,7 +17,7 @@ export async function onRequestPost({ request, env }) {
return new Response(`{"error":"Resend error: ${text}"}`, { status: 500, headers: { 'Content-Type': 'application/json' } }); return new Response(`{"error":"Resend error: ${text}"}`, { status: 500, headers: { 'Content-Type': 'application/json' } });
} }
await fetch(`https://ntfy.sh/${env.NTFY_TOPIC}`, { await fetch(env.NTFY_URL, {
method: 'POST', method: 'POST',
headers: { Priority: '3', Title: `🔕 Unsubscribe` }, headers: { Priority: '3', Title: `🔕 Unsubscribe` },
body: email body: email