Formulário no v0
Sem Server Actions nem Resend. Um fetch para o Formgong chega.
- Gere a secção com o prompt.
- Verifique Accept e Content-Type.
- O sucesso é o campo success.
- Deixe a chave no frontend.
Prompt
Adiciona uma secção de contacto. Não uses Server Actions nem Resend. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. Campos name, email, message e honeypot botcheck. fetch com Content-Type application/json e Accept: application/json. Sucesso: result.success. Sem ficheiros.
fetch
async function onSubmit(event) {
event.preventDefault();
const fields = Object.fromEntries(new FormData(event.currentTarget));
const response = await fetch("https://formgong.com/submit", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({ ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
if (!result.success) throw new Error(result.message || "Formgong error");
}