DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsEmailContact Forms
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Sending EmailsEmail TemplatesContact Forms
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Contact Forms

Handle storefront contact form submissions.

Updated March 29, 2026

On this page
  • Overview
  • SDK Usage
  • Contact Form Component
  • REST API
  • Viewing Submissions
  • Next Steps

Overview

Accept contact form submissions from your storefront. Submissions are stored in the dashboard and can trigger email notifications.

SDK Usage

typescript
import dash from "@/lib/dash"

const { success, message, submission_id } = await dash.contact.submit({
  name: "Jane Doe",
  email: "jane@example.com",
  content: "I have a question about my order...",
  phone: "555-0123",           // optional
  subject: "Order Question",    // optional
  source_url: window.location.href,  // optional
  turnstile_token: "...",       // optional captcha
})

Contact Form Component

typescript
"use client"
import { useState } from "react"
import dash from "@/lib/dash"

export function ContactForm() {
  const [form, setForm] = useState({ name: "", email: "", content: "" })
  const [status, setStatus] = useState<"idle" | "sending" | "sent" | "error">("idle")

  async function handleSubmit(e) {
    e.preventDefault()
    setStatus("sending")
    try {
      await dash.contact.submit(form)
      setStatus("sent")
    } catch {
      setStatus("error")
    }
  }

  if (status === "sent") return <p>Thank you! We'll get back to you soon.</p>

  return (
    <form onSubmit={handleSubmit}>
      <input placeholder="Name" required
             value={form.name} onChange={e => setForm(f => ({...f, name: e.target.value}))} />
      <input placeholder="Email" type="email" required
             value={form.email} onChange={e => setForm(f => ({...f, email: e.target.value}))} />
      <textarea placeholder="Message" required
                value={form.content} onChange={e => setForm(f => ({...f, content: e.target.value}))} />
      <button type="submit" disabled={status === "sending"}>
        {status === "sending" ? "Sending..." : "Send Message"}
      </button>
      {status === "error" && <p className="text-red-500">Something went wrong. Please try again.</p>}
    </form>
  )
}

REST API

shell
POST /storefront/contact
X-API-Key: pk_live_your_key
Content-Type: application/json

{
  "name": "Jane Doe",
  "email": "jane@example.com",
  "content": "I have a question about my order...",
  "subject": "Order Question"
}

Viewing Submissions

All contact form submissions appear in the dashboard under Contacts. You can reply to them, mark as resolved, and view submission details.

Next Steps

  • Form Setup — Advanced form configuration
  • Submissions API — Managing submissions programmatically
PreviousEmail TemplatesNextUpload Files

On this page

  • Overview
  • SDK Usage
  • Contact Form Component
  • REST API
  • Viewing Submissions
  • Next Steps