Compare commits
9 Commits
fd52692020
...
0ee8179093
| Author | SHA1 | Date |
|---|---|---|
|
|
0ee8179093 | |
|
|
9944d430dc | |
|
|
8e581bfd30 | |
|
|
c980c04214 | |
|
|
423bd2eef3 | |
|
|
71f71aa80a | |
|
|
c21f2d2ed3 | |
|
|
8dbd45af09 | |
|
|
725ad2aa1c |
|
|
@ -3,7 +3,7 @@
|
|||
import { useState } from "react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
const LISTMONK_URL = "https://newsletter.jeffemmett.com"
|
||||
const NEWSLETTER_API = "https://newsletter.jeffemmett.com/api/subscribe"
|
||||
const LIST_UUID = "0c541da4-3f04-4e72-978a-5a328b43c995" // Alltornet list
|
||||
|
||||
export function NewsletterSignup() {
|
||||
|
|
@ -19,21 +19,20 @@ export function NewsletterSignup() {
|
|||
setStatus("loading")
|
||||
|
||||
try {
|
||||
const response = await fetch(`${LISTMONK_URL}/api/public/subscription`, {
|
||||
const response = await fetch(`${NEWSLETTER_API}/subscribe`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
email: email,
|
||||
list_uuids: [LIST_UUID],
|
||||
name: "",
|
||||
list_uuid: LIST_UUID,
|
||||
}),
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
setStatus("success")
|
||||
setMessage("Check your email to confirm your subscription!")
|
||||
setMessage("Connect to the Alltor.net. Something's emerging.")
|
||||
setEmail("")
|
||||
} else {
|
||||
throw new Error("Subscription failed")
|
||||
|
|
|
|||
Loading…
Reference in New Issue