Lovableのフォーム
プロンプトにはキー、送信先、ハニーポットが入っています。SupabaseもResend呼び出しも追加しないでください。Lovableにバックエンドは作らせないでください。
- トップページでキーを受け取る。
- Lovableのプロジェクトを開く。
- 下のプロンプトを貼る。
- テストを送り、Formgongの画面で開く。
- 設定からTelegramをつなぐ。
Prompt
問い合わせを Formgong に送るフォームを追加してください。バックエンド、データベース、秘密情報は作らないでください。 - POST https://formgong.com/submit - 隠し項目 access_key の値は fk_your_access_key(キーは公開してよい) - 項目: name, email, 任意の phone, message。ラベルは日本語 - ハニーポット: 画面外に隠した botcheck - ファイル送信もサーバー関数もなし - 普通の HTML フォーム、または Accept: application/json の fetch。成功は 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: "ja", ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
setStatus(result.message || (result.success ? "送信しました。ありがとうございます。" : "送信できませんでした。もう一度お試しください。"));
}
return (
<form onSubmit={onSubmit}>
<label>お名前 <input name="name" placeholder="山田 太郎" required /></label>
<label>メールアドレス <input name="email" type="email" placeholder="you@example.com" required /></label>
<label>メッセージ <textarea name="message" placeholder="ご用件をご記入ください" 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">送信</button>
<p role="status">{status}</p>
</form>
);
}すぐ使える Lovable プロジェクト: lovable.dev. 開いて Remix をクリックし、src/components/ContactForm.tsx にアクセスキーを入れてください。
すぐ使える React コンポーネント(GitHub): github.com/formgong/react-contact-form. MIT ライセンス:「Use this template」をクリックするか、ファイルをコピーしてください。
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.