نموذج في Lovable

الموجّه يتضمن المفتاح ونقطة الإرسال وفخ الرسائل المزعجة. لا تضف Supabase ولا استدعاء Resend. لا تدع Lovable ينشئ خادماً.

  1. احصل على المفتاح من الصفحة الرئيسية.
  2. افتح المشروع في Lovable.
  3. الصق الموجّه أدناه.
  4. أرسل تجربة وافتحها في لوحة Formgong.
  5. اربط Telegram من الإعدادات.

Prompt

أضف نموذج تواصل يرسل الطلبات إلى Formgong. لا تنشئ خادماً ولا قاعدة بيانات ولا أسراراً.

- POST https://formgong.com/submit
- حقل مخفي access_key بقيمة fk_your_access_key (المفتاح علني)
- الحقول: name وemail وphone اختياري وmessage. التسميات بالعربية
- فخ: حقل botcheck مخفي خارج الشاشة
- بلا ملفات وبلا دوال خادم
- نموذج HTML عادي، أو fetch مع Accept: application/json. النجاح هو 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: "ar", ...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.

نموذج تواصل لـ Lovable →

مفتاح وصول