نموذج في Cursor

اطلب من الوكيل ألا ينشئ مسار API. النموذج يتحدث مباشرة مع Formgong.

  1. افتح المستودع في Cursor.
  2. الصق الموجّه.
  3. تأكد أنه لا يوجد سر خادم لهذا النموذج فقط.
  4. صدّر CSV عندما تصل الطلبات.

Prompt

أضف نموذج تواصل يرسل إلى Formgong. لا تنشئ مسار API في هذا المستودع.

POST https://formgong.com/submit
access_key: fk_your_access_key
الحقول: name وemail وmessage وbotcheck مخفي.
مع fetch أرسل Accept: application/json وتحقق من success.

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

HTML

<form action="https://formgong.com/submit" method="POST">
  <input type="hidden" name="access_key" value="fk_your_access_key">
  <input type="hidden" name="_lang" value="ar">
  <label>الاسم <input type="text" name="name" autocomplete="name" placeholder="اسمك" required></label>
  <label>البريد الإلكتروني <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
  <label>الرسالة <textarea name="message" placeholder="كيف يمكننا مساعدتك؟" required></textarea></label>
  <div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
  <label>اترك هذا الحقل فارغًا<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
  
  <button type="submit">إرسال</button>
</form>

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",
    },
    // _lang: language of Formgong messages and the autoreply (multilingual site: document.documentElement.lang).
    body: JSON.stringify({ _lang: "ar", ...fields, access_key: "fk_your_access_key" }),
  });
  const result = await response.json();
  if (!result.success) throw new Error(result.message || "تعذّر الإرسال. يرجى المحاولة مرة أخرى.");
  return result.message; // localized "Sent. Thank you!"
}

أضف إلى مشروع قائم: npx formgong init (npm: formgong)

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.

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

مفتاح وصول