Contact Form

Unfold CMS includes a built-in contact form system that allows visitors to send messages through your website. Messages are delivered to administrators via email and stored in the admin panel.

Overview

The contact form provides:

  • Public form — Visitors fill out name, email, subject, and message
  • Admin notifications — Email sent to administrators on submission
  • Admin management — View and manage submissions in the admin panel
  • File attachments — Optional file upload support
  • Spam protection — Honeypot, CSRF, and rate limiting

Configuration

Configure the contact form in Settings > Contact Form in the admin panel.

Form Fields

The contact form includes these fields:

Field Required Description
Name Yes Sender's name
Email Yes Sender's email address
Subject Yes Message subject line
Message Yes Message body
Attachment No Optional file attachment

Embedding the Contact Form

The contact form is typically rendered via a shortcode in page content or directly in a template:

Using the Shortcode

In any page content, insert:

[contact-form]

The CMS renders the contact form component at that position.

In Templates

Templates include a contact form component:

@include('templates.default.components.shortcodes.contact-form')

Spam Protection

The contact form is protected by multiple layers:

Protection How It Works
Honeypot Invisible fields that trap bots (@honeypot directive)
CSRF Token Validates the form was submitted from your site
Rate Limiting 5 submissions per minute per IP
Email Validation Server-side email format validation
File Validation Checks extension and size limits

Admin Panel

Viewing Submissions

Navigate to Support > Contact Messages in the admin panel to view all contact form submissions.

Each submission shows:

  • Sender name and email
  • Subject line
  • Submission date
  • Read/unread status
  • Attached files (if any)

Managing Submissions

Administrators can:

  • View full message content
  • Download attachments
  • Mark as read/unread
  • Delete submissions

Email Notifications

When a visitor submits the contact form:

  1. The submission is saved to the database
  2. An email notification is sent to the configured admin email
  3. If no admin email is set, it falls back to app.support_email
  4. If that's also not set, it goes to the first Super Admin user

The notification email includes the sender's name, email, subject, and message content.