Formulário no Lovable

O prompt já traz a chave, o endpoint e o honeypot. Não adicione Supabase nem uma chamada Resend. O Lovable não deve criar um backend.

  1. Obtenha a chave na página inicial.
  2. Abra o projeto no Lovable.
  3. Cole o prompt abaixo.
  4. Envie um teste e abra-o no painel.
  5. Ligue o Telegram nas definições.

Prompt

Adiciona um formulário de contacto que envie os pedidos ao Formgong. Não cries backend, base de dados nem segredos.

- POST https://formgong.com/submit
- Campo oculto access_key com o valor fk_your_access_key (a chave é pública)
- Campos: name, email, phone opcional, message. Etiquetas em português
- Honeypot: campo botcheck escondido fora do ecrã
- Sem ficheiros nem funções de servidor
- Formulário HTML simples, ou fetch com Accept: application/json. Sucesso: 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: "pt", ...fields, access_key: "fk_your_access_key" }),
    });
    const result = await response.json();
    setStatus(result.message || (result.success ? "Enviado. Obrigado!" : "Não foi possível enviar. Tente novamente."));
  }

  return (
    <form onSubmit={onSubmit}>
      <label>Nome <input name="name" placeholder="O seu nome" required /></label>
      <label>E-mail <input name="email" type="email" placeholder="voce@exemplo.com" required /></label>
      <label>Mensagem <textarea name="message" placeholder="Como podemos ajudar?" 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>
  );
}

Projeto pronto no Lovable: lovable.dev. Abra-o, clique em Remix e coloque sua chave de acesso em src/components/ContactForm.tsx.

Componente React pronto no GitHub: github.com/formgong/react-contact-form. Licença MIT: clique em “Use this template” ou copie os arquivos.

Pacote 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.

Formulário de contacto para Lovable →

Obter chave