نموذج تواصل لـ Replit

Formgong team ·

الصق هذا في Replit. الطلبات تذهب إلى Formgong. بلا قاعدة بيانات وبلا Resend.

250 طلب مجاني في الشهر

كيف تعمل النماذج في Replit

Replit Agent عادةً ما يُستخدم لإنشاء تطبيقات كاملة: واجهة مستخدم تعمل بتقنية React مع خادم Express، وغالبًا ما تتضمن قاعدة بيانات وإرسال بريد إلكتروني يتم تكوينهما عبر Replit Secrets. بالنسبة لنموذج الاتصال، يعني ذلك وجود كود خادم وجدول وحساب بريد إلكتروني يجب عليك الحفاظ على تشغيله.

يتم إرسال نموذج Formgong من متصفح الزائر إلى https://formgong.com/submit، وبالتالي لا يتدخل الخادم في العملية. ويعمل النظام بنفس الطريقة سواء في حالة النشر باستخدام ميزة «التحجيم التلقائي» (Autoscale) أو في حالة النشر «الثابت» (Static) لموقع لا يحتوي على نظام خلفي.

الإعداد في Replit

  1. أنشئ نموذجًا في Formgong وانسخ مفتاح الوصول.
  2. الصق الموجّه أدناه في Replit Agent. وهو يطلب نموذج واجهة مستخدم فقط، بدون مسار Express أو جدول قاعدة بيانات أو سر البريد الإلكتروني.
  3. تحقق من الملفات التي قام الوكيل بتغييرها: يجب ألا يكون هناك مسار جديد لـ /api/contact ولا سر جديد للنموذج.
  4. قم بتشغيل التطبيق، وأرسل اختبارًا من «webview» وافتحه في صندوق الوارد الخاص بـ Formgong.
  5. النشر. إذا كان الموقع لا يحتوي على أي كود خادم على الإطلاق، يكفي النشر الثابت؛ وإلا فاحتفظ بنوع النشر الذي اختاره الوكيل.

دليل خطوة بخطوة في الوثائق

Replit
Add a contact form to this app. Keep it frontend-only: submissions go to Formgong, a hosted form backend. Replit Agent: do not add an Express or Flask route, a database, Replit Secrets, or nodemailer for this form.

Formgong spec (follow exactly):
- Plain HTML: <form action="https://formgong.com/submit" method="POST">. With JavaScript, POST the same fields to https://formgong.com/submit using fetch.
- Hidden field access_key with value fk_your_access_key. The key is public and belongs in frontend code. Do not move it to a server or a secret.
- Hidden field _lang with the page language code, e.g. "en" (on multilingual sites use document.documentElement.lang). Formgong uses it for error messages, the thank-you page, and the autoreply.
- Fields: name, email, message (required); phone is optional. Keep these field names, and use <input type="email"> for email so browsers check the address.
- Honeypot: <input type="text" name="botcheck" tabindex="-1" autocomplete="off"> inside a wrapper with aria-hidden="true", visually hidden with CSS (position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)). Never fill it.
- Success, plain form POST: optionally add a hidden _redirect field with the absolute https URL of the site's thank-you page. Without it, Formgong shows its own thank-you page.
- Success, fetch: send Accept: application/json (and Content-Type: application/json for a JSON body; for FormData let the browser set it). If the response has success === true, show an inline thank-you message and reset the form; otherwise show the response's message.
- Turnstile: only if I give you a Cloudflare Turnstile site key, add <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> and <div class="cf-turnstile" data-sitekey="SITE_KEY"></div> inside the form. Otherwise leave it out.
- Optional: add <script src="https://formgong.com/fg.js" async></script> once per page. It fills _lang from <html lang>, sets the Turnstile language, and counts form views without cookies.
- Do not create a backend, API route, server function, database table, or email-sending code (Supabase, Resend, SendGrid, nodemailer), and do not add secrets. No file uploads.

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

Formgong أم مسار Express؟

يكون المسار الخاص بك منطقيًا عندما يغذي الطلب التطبيق: تخزينه في قاعدة بيانات Postgres الخاصة بك، أو ربطه بمستخدم ما، أو بدء مهمة ما.

Formgong هو الطريق الأسرع لنماذج الاتصال والطلبات: لا حاجة إلى كود خادم، ولا مزود بريد إلكتروني، ولا قاعدة بيانات يجب صيانتها، مع تضمين ميزة التسليم عبر Telegram وتصفية الرسائل غير المرغوب فيها.

أسئلة وأجوبة

هل يجب إدخال مفتاح الوصول في «أسرار Replit»؟

لا. مفتاح الوصول عام ويجب أن يصل إلى المتصفح. الأسرار مخصصة للقيم الخاصة؛ فوجود مفتاح مخفي على الخادم سيؤدي إلى تعطل نموذج المتصفح.

أضاف الوكيل قاعدة بيانات للنموذج. هل هذا يمثل مشكلة؟

هذا عمل إضافي، وليس خطأً. إذا لم يكن هناك أي عنصر آخر يقرأ الجدول، فاطلب من الوكيل إزالته والاحتفاظ بالنموذج الأمامي فقط.

هل يمكنني إجراء اختبار قبل النشر؟

نعم. الطلبات المرسلة من عرض الويب Replit حقيقية وتظهر في صندوق الوارد الخاص بـ Formgong. احذف الإدخالات التجريبية من هناك عند الانتهاء.

ابدأ مجانًا