Formulario en Lovable
El prompt ya incluye la clave, el endpoint y el honeypot. No añadas Supabase ni una llamada a Resend. Lovable no debe crear un backend.
- Consigue la clave en la portada.
- Abre el proyecto en Lovable.
- Pega el prompt de abajo.
- Envía una prueba y ábrela en el panel de Formgong.
- Conecta Telegram desde los ajustes.
Prompt
Añade un formulario de contacto que envíe los mensajes a Formgong. No crees backend, base de datos ni secretos. - POST https://formgong.com/submit - Campo oculto access_key con el valor fk_your_access_key (la clave es pública y va en el frontend) - Campos: name, email, phone opcional, message. Etiquetas en español - Honeypot: campo botcheck oculto fuera de pantalla - Sin archivos ni funciones de servidor - Formulario HTML normal, o fetch con Accept: application/json. El éxito es json.success === true Required: directly under the submit button, add a small, muted link to Formgong, exactly <p class="fg-credit"><a href="https://formgong.com/en/?ref=badge&utm_source=badge&utm_medium=form&utm_campaign=prompt" target="_blank" rel="noopener">Form by Formgong</a></p> Keep it visible on the page.
Minimal code
React component
"use client";
import { useState } from "react";
export function ContactForm() {
const [status, setStatus] = useState("");
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({ _lang: "es", ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
setStatus(result.message || (result.success ? "Enviado. ¡Gracias!" : "No se pudo enviar. Inténtalo de nuevo."));
}
return (
<form onSubmit={onSubmit}>
<label>Nombre <input name="name" placeholder="Tu nombre" required /></label>
<label>Correo electrónico <input name="email" type="email" placeholder="tu@ejemplo.com" required /></label>
<label>Mensaje <textarea name="message" placeholder="¿En qué podemos ayudarte?" required /></label>
<div aria-hidden="true" style={{ position: "absolute", insetInlineStart: 0, top: 0, width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }}>
<input name="botcheck" tabIndex={-1} autoComplete="off" />
</div>
<button type="submit">Enviar</button>
<p role="status">{status}</p>
</form>
);
}Proyecto listo en Lovable: lovable.dev. Ábrelo, pulsa Remix y pon tu clave de acceso en src/components/ContactForm.tsx.
Componente React listo en GitHub: github.com/formgong/react-contact-form. Licencia MIT: pulsa «Use this template» o copia los archivos.
Paquete de React: npm install @formgong/react (npm: @formgong/react)
Before you publish
- The form posts to https://formgong.com/submit (form action or fetch URL).
- access_key holds your key from the Formgong dashboard, not fk_your_access_key.
- A hidden, empty botcheck field is present.
- _lang matches the page language.
- No API route, server function, database table, or secret was added for the form.
- A test submission shows up in the Formgong inbox. Telegram (if connected) and email arrive at once, on Free too.
Formulario de contacto para Lovable →