layout | title |
---|---|
default |
Urgent Contact |
If you have an access token then you can send me an urgent message using this form:
Leave blank if you're human: Email address: Message: <textarea name="message" id="message" placeholder="Message" style="box-sizing:border-box; width:100%; max-width:60em; height:15em" required></textarea> Token: Send <script> document.getElementById("contact-form").addEventListener("submit", event => { event.preventDefault(); const formData = new FormData(event.target); const token = formData.get("token"); fetch("/api/token-verify", { method: "POST", headers: { "accept": "application/json", "content-type": "application/json", }, body: JSON.stringify({ token }) }) .then(res => res.json()) .then(res => { const element = document.getElementById("token-verify-output"); if (!res.ok) { alert(`Token ${token} does not appear to be valid.`) } else { fetch("/api/contact-urgent", { method: "POST", headers: { "accept": "application/json", "content-type": "application/json", }, body: JSON.stringify(Object.fromEntries(formData.entries())) }) .then(res => res.json()) .then(res => { if (res.success) { alert("Your message has been sent successfully."); event.target.reset(); } else { alert("An unknown error occurred."); } }) } }); }); </script>