SelfPing is a simple API that helps you send texts to your own phone from any app, website, server, or API. Setup takes just a few lines of code.
async function handleSubmit(formData: FormData) {
"use server";
const name = formData.get("name");
const email = formData.get("email");
const message = formData.get("message");
const res = await fetch("https://www.selfping.com/api/sms", {
method: "POST",
body: JSON.stringify({
message: name + " submitted your contact form with " +
"email: " + email + " and message: " + message,
}),
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + process.env.SELFPING_API_KEY,
},
});
}