Compare commits

..

No commits in common. "0ee81790935bf3e6f9d6bbf8e2654a0fbe549634" and "fd5269202035c57772b4259d81d02dc8767d9082" have entirely different histories.

1 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@
import { useState } from "react"
import { Button } from "@/components/ui/button"
const NEWSLETTER_API = "https://newsletter.jeffemmett.com/api/subscribe"
const LISTMONK_URL = "https://newsletter.jeffemmett.com"
const LIST_UUID = "0c541da4-3f04-4e72-978a-5a328b43c995" // Alltornet list
export function NewsletterSignup() {
@ -19,20 +19,21 @@ export function NewsletterSignup() {
setStatus("loading")
try {
const response = await fetch(`${NEWSLETTER_API}/subscribe`, {
const response = await fetch(`${LISTMONK_URL}/api/public/subscription`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: email,
list_uuid: LIST_UUID,
list_uuids: [LIST_UUID],
name: "",
}),
})
if (response.ok) {
setStatus("success")
setMessage("Connect to the Alltor.net. Something's emerging.")
setMessage("Check your email to confirm your subscription!")
setEmail("")
} else {
throw new Error("Subscription failed")