نموذج تواصل لـ v0
Formgong team ·
الصق هذا في v0. الطلبات تذهب إلى Formgong. بلا قاعدة بيانات وبلا Resend.
250 طلب مجاني في الشهر
كيف تعمل النماذج في v0
v0 كود Next.js App Router باستخدام shadcn/ui و Tailwind. بالنسبة للنماذج، عادةً ما يكتب «إجراء خادم» (Server Action) أو مسار واجهة برمجة تطبيقات (API route) يرسل البريد الإلكتروني عبر مزود مثل Resend. وهذا يتطلب وقت تشغيل خادم ومفتاح واجهة برمجة تطبيقات (API key) في متغيرات بيئة Vercel الخاصة بك، وتقع مسؤولية صيانة الكود على عاتقك.
مع Formgong، يُعد النموذج مكونًا للعميل يستدعي fetch على https://formgong.com/submit. لا يتم تشغيل أي شيء على الخادم الخاص بك من أجل النموذج، لذا فإنه يعمل أيضًا عند تصدير التطبيق كملفات ثابتة.
الإعداد في v0
- أنشئ نموذجًا في Formgong وانسخ مفتاح الوصول.
- الصق الموجّه أدناه في v0. يمكنك أيضًا إضافة
https://formgong.com/llms.txtإلى مصادر المشروع حتى تتعرف الدردشات اللاحقة على الحقول. - تحقق من النتيجة: يبدأ المكون بـ
"use client"، ويتم النشر إلى Formgong، ولا يوجد ملف جديد تحتapp/apiولا يوجد إجراء خادم (Server Action) للنموذج. - إذا كنت تستخدم نموذج shadcn مع react-hook-form، فاحتفظ به: ضع استدعاء
fetchفي معالجonSubmit. - قم بالنشر على Vercel، وأرسل اختبارًا، وقم بربط Telegram في إعدادات النموذج.
Add a contact section with a form. Build it as a React client component ("use client") that posts with fetch. Submissions go to Formgong, a hosted form backend. Do not use Server Actions, route handlers (app/api), or Resend.
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.Додай контактну секцію з формою. Не використовуй Server Actions і не підключай Resend. Форма відправляє дані в Formgong: - URL: https://formgong.com/submit - access_key: fk_your_access_key - Поля: name, email, message - Приховане honeypot-поле botcheck - fetch з Content-Type: application/json та Accept: application/json - Якщо result.success, покажи стан успіху - Без завантаження файлів Додатково: - Поле email роби з type="email", щоб браузер перевіряв адресу. - Приховане поле _lang зі значенням uk (мова сторінки): так помилки, сторінка подяки й автовідповідь будуть українською. - Необов'язково: приховане поле _redirect з повною https-адресою вашої сторінки подяки. Без нього Formgong покаже власну сторінку подяки. - Необов'язково: <script src="https://formgong.com/fg.js" async></script> один раз на сторінці. Він підставляє _lang з <html lang> і рахує перегляди форми без cookies. - Turnstile додавай лише тоді, коли я дам site key.
Dodaj sekcję kontaktową. Nie używaj Server Actions ani Resend. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. Pola name, email, message, ukryte botcheck. fetch z Content-Type application/json i Accept: application/json. Sukces: result.success. Bez plików. Dodatkowo: - Pole email ustaw jako type="email", żeby przeglądarka sprawdzała adres. - Ukryte pole _lang o wartości pl (język strony): komunikaty błędów, strona z podziękowaniem i autoodpowiedź będą po polsku. - Opcjonalnie: ukryte pole _redirect z pełnym adresem https Twojej strony z podziękowaniem. Bez niego Formgong pokaże własną stronę z podziękowaniem. - Opcjonalnie: <script src="https://formgong.com/fg.js" async></script> raz na stronie. Uzupełnia _lang z <html lang> i liczy wyświetlenia formularza bez cookies. - Turnstile dodaj tylko wtedy, gdy podam site key.
İletişim bölümü ekle. Server Actions veya Resend kullanma. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. Alanlar: name, email, message, gizli botcheck. fetch: Content-Type application/json ve Accept: application/json. Başarı: result.success. Dosya yok. Ayrıca: - email alanını type="email" yap, böylece tarayıcı adresi kontrol eder. - Değeri tr olan gizli _lang alanı (sayfanın dili): hata mesajları, teşekkür sayfası ve otomatik yanıt Türkçe olur. - İsteğe bağlı: teşekkür sayfanızın tam https adresini taşıyan gizli _redirect alanı. Yoksa Formgong kendi teşekkür sayfasını gösterir. - İsteğe bağlı: sayfaya bir kez <script src="https://formgong.com/fg.js" async></script>. _lang alanını <html lang> değerinden doldurur ve form görüntülemelerini çerezsiz sayar. - Turnstile'ı yalnızca site key verirsem ekle.
Añade una sección de contacto. No uses Server Actions ni Resend. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. Campos name, email, message y honeypot botcheck. fetch con Content-Type application/json y Accept: application/json. Éxito: result.success. Sin archivos.
Ajoute une section contact. N’utilise ni Server Actions ni Resend. Formgong : POST https://formgong.com/submit, access_key fk_your_access_key. Champs name, email, message et honeypot botcheck. fetch avec Content-Type application/json et Accept: application/json. Succès : result.success. Pas de fichiers.
Adiciona uma secção de contacto. Não uses Server Actions nem Resend. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. Campos name, email, message e honeypot botcheck. fetch com Content-Type application/json e Accept: application/json. Sucesso: result.success. Sem ficheiros.
أضف قسماً للتواصل. لا تستخدم Server Actions ولا Resend. Formgong: POST https://formgong.com/submit والمفتاح fk_your_access_key. الحقول name وemail وmessage وفخ botcheck. fetch مع Content-Type application/json و Accept: application/json. النجاح: result.success. بلا ملفات.
הוסף מקטע יצירת קשר. אל תשתמש ב-Server Actions או ב-Resend. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. שדות name, email, message ומלכודת botcheck. fetch עם Content-Type application/json ו-Accept: application/json. הצלחה: result.success. בלי קבצים.
संपर्क सेक्शन जोड़ो। Server Actions या Resend मत लगाओ। Formgong: POST https://formgong.com/submit, access_key fk_your_access_key। फ़ील्ड name, email, message और honeypot botcheck। fetch में Content-Type application/json और Accept: application/json। सफलता: result.success। फ़ाइल नहीं।
問い合わせセクションを追加してください。Server Actions と Resend は使わないでください。 Formgong: POST https://formgong.com/submit、access_key は fk_your_access_key。 項目は name, email, message とハニーポット botcheck。 fetch は Content-Type application/json と Accept: application/json。 成功は result.success。ファイルは送らない。
Füge einen Kontaktbereich mit Formular hinzu. Verwende keine Server Actions und kein Resend. Formgong: POST https://formgong.com/submit, access_key fk_your_access_key. Felder name, email, message und verstecktes Honeypot-Feld botcheck. fetch mit Content-Type application/json und Accept: application/json. Erfolg: result.success. Keine Datei-Uploads. Beschriftungen auf Deutsch. Zusätzlich: - Das Feld email mit type="email" anlegen, damit der Browser die Adresse prüft. - Verstecktes Feld _lang mit dem Wert de (Sprache der Seite): Fehlermeldungen, Danke-Seite und automatische Antwort erscheinen dann auf Deutsch. - Optional: verstecktes Feld _redirect mit der vollständigen https-Adresse deiner Danke-Seite. Ohne dieses Feld zeigt Formgong eine eigene Danke-Seite. - Optional: <script src="https://formgong.com/fg.js" async></script> einmal pro Seite. Es setzt _lang aus <html lang> und zählt Formularansichten ohne Cookies. - Turnstile nur einbauen, wenn ich dir einen Site Key gebe.
مكوّن React جاهز على GitHub: github.com/formgong/react-contact-form. ترخيص MIT: انقر على «Use this template» أو انسخ الملفات.
حزمة React: npm install @formgong/react (npm: @formgong/react)
Formgong أم إجراء الخادم؟
اكتب «إجراء الخادم» الخاص بك عندما يتعين على الطلب تغيير بياناتك الخاصة، على سبيل المثال إنشاء سجل في قاعدة البيانات الخاصة بك أو التحقق من مستخدم مسجل الدخول.
استخدم Formgong لنماذج الاتصال وعروض الأسعار والطلبات. يمكنك تجاوز مزود البريد الإلكتروني، وكلمات المرور السرية، ومعالجة الرسائل غير المرغوب فيها، والحصول على خدمة التسليم عبر Telegram وصندوق الوارد.
أسئلة وأجوبة
لماذا لا تدع v0 يكتب «إجراء خادم» يقوم بإعادة التوجيه إلى Formgong؟
سيأتي كل طلب بعد ذلك من عنوان IP الخاص بخادمك، مما يضعف حدود معدل الزيارات لكل زائر وإشارات البريد العشوائي. الإرسال من المتصفح أبسط ويعمل بشكل أفضل.
هل يعمل مع التصدير الثابت؟
نعم. لا يدعم التصدير الثابت في Next.js «إجراءات الخادم» (Server Actions)، لكن المكون الخاص بالعميل الذي يقوم بالإرسال إلى Formgong لا يحتاج إلى خادم.
أين يجب وضع مفتاح الوصول؟
مباشرةً في المكون أو في متغير بيئة NEXT_PUBLIC_. المفتاح عام، لذا لا ينتمي إلى سر مخصص للخادم فقط.