Adds a contact-messages collection, a settings global and a submit endpoint to Payload. Includes a drop-in ContactForm client component and an admin inbox view with message stats. Spam is handled with a honeypot field, a per-IP rate limit and blocked keywords. Requires Payload 3.90 or later and a database migration for the new collection and global.
Contact form plugin for Payload 3.x: a message inbox collection, runtime settings, spam protection (honeypot + rate limit), an admin inbox view, and a ready-to-use form component.
Installation
npm i @navanem/payload-contact2
Stars
0
Forks
10
Open Issues
1 months ago
Last Updated
0
Weekly Downloads
v
npm Version
Dependencies
20 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 2 |
| Dec 5, 2026 | 2 |
| Dec 4, 2026 | 2 |
| Dec 3, 2026 | 2 |
| Dec 2, 2026 | 2 |
| Dec 1, 2026 | 2 |
| Nov 30, 2026 | 2 |
| Nov 29, 2026 | 2 |
| Nov 28, 2026 | 2 |
| Nov 27, 2026 | 2 |
| Nov 26, 2026 | 2 |
| Nov 25, 2026 | 2 |
| Nov 24, 2026 | 2 |
| Nov 23, 2026 | 2 |
| Nov 22, 2026 | 2 |
| Nov 21, 2026 | 2 |
| Nov 20, 2026 | 2 |
| Nov 19, 2026 | 2 |
| Nov 18, 2026 | 2 |
| Nov 17, 2026 | 2 |
| Nov 16, 2026 | 2 |
| Nov 15, 2026 | 2 |
| Nov 14, 2026 | 2 |
| Nov 13, 2026 | 2 |
| Nov 12, 2026 | 2 |
| Nov 11, 2026 | 2 |
| Nov 10, 2026 | 2 |
| Nov 9, 2026 | 2 |
| Nov 8, 2026 | 2 |
| Nov 7, 2026 | 2 |
| Nov 6, 2026 | 2 |
| Nov 5, 2026 | 2 |
| Nov 4, 2026 | 2 |
| Nov 3, 2026 | 2 |
| Nov 2, 2026 | 2 |
| Nov 1, 2026 | 2 |
| Oct 31, 2026 | 2 |
| Oct 30, 2026 | 2 |
| Oct 29, 2026 | 2 |
| Oct 28, 2026 | 2 |
| Oct 27, 2026 | 2 |
| Oct 26, 2026 | 2 |
| Oct 25, 2026 | 2 |
| Oct 24, 2026 | 2 |
| Oct 23, 2026 | 2 |
| Oct 22, 2026 | 2 |
| Oct 21, 2026 | 2 |
| Oct 20, 2026 | 2 |
| Oct 19, 2026 | 2 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 2 |
| Oct 15, 2026 | 2 |
| Oct 14, 2026 | 2 |
| Oct 13, 2026 | 2 |
| Oct 12, 2026 | 2 |
| Oct 11, 2026 | 2 |
| Oct 10, 2026 | 2 |
| Oct 9, 2026 | 2 |
| Oct 8, 2026 | 2 |
| Oct 7, 2026 | 2 |
| Oct 6, 2026 | 2 |
| Oct 5, 2026 | 2 |
| Oct 4, 2026 | 2 |
| Oct 3, 2026 | 2 |
| Oct 2, 2026 | 2 |
| Oct 1, 2026 | 2 |
| Sep 30, 2026 | 2 |
| Sep 29, 2026 | 2 |
| Sep 28, 2026 | 2 |
| Sep 27, 2026 | 2 |
| Sep 26, 2026 | 2 |
| Sep 25, 2026 | 2 |
| Sep 24, 2026 | 2 |
| Sep 23, 2026 | 2 |
| Sep 22, 2026 | 2 |
| Sep 21, 2026 | 2 |
| Sep 20, 2026 | 2 |
| Sep 19, 2026 | 2 |
| Sep 18, 2026 | 2 |
| Sep 17, 2026 | 2 |
| Sep 16, 2026 | 2 |
| Sep 15, 2026 | 2 |
| Sep 14, 2026 | 2 |
| Sep 13, 2026 | 2 |
| Sep 12, 2026 | 2 |
| Sep 11, 2026 | 2 |
| Sep 10, 2026 | 2 |
| Sep 9, 2026 | 2 |
| Sep 8, 2026 | 2 |
| Sep 7, 2026 | 2 |
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1274892328-root)<a href="https://payloaddirectory.dev/plugins/1274892328-root"><img src="https://payloaddirectory.dev/badge/1274892328-root.svg" alt="Payload Directory"></a>README
A contact-form plugin for Payload 3.x. It gives you a public form component, a validated submit endpoint with built-in spam protection, an admin inbox to read and triage messages, and a settings global to open/close the form and tune it at runtime — no redeploy required. No email is sent or exposed; messages are stored in your Payload admin.
Built by navanem — the same author as @navanem/payload-comments.
contact-messages collection (admin-read) with new / read / replied status, so the form acts as a triageable inbox./admin/contact-inbox) with KPIs
(total / new / read / replied), period filters and a recent-messages table.<ContactForm /> client component.This plugin follows the same vendored model as @navanem/payload-comments: copy the
source into your project (so the admin component paths resolve via your import map), or
install from npm once published.
# copy the plugin source into your project
cp -r node_modules/@navanem/payload-contact/src src/plugins/payload-contact
# (or git clone and copy src/ in)
Then register the admin components in your generated app/(payload)/admin/importMap.js:
import { ContactInboxView } from '@/plugins/payload-contact/components/ContactInboxView'
import { ContactInboxNavLink } from '@/plugins/payload-contact/components/ContactInboxNavLink'
export const importMap = {
// ...
'@/plugins/payload-contact/components/ContactInboxView#ContactInboxView': ContactInboxView,
'@/plugins/payload-contact/components/ContactInboxNavLink#ContactInboxNavLink': ContactInboxNavLink,
}
npm install @navanem/payload-contact
// payload.config.ts
import { contactPlugin } from '@navanem/payload-contact' // or '@/plugins/payload-contact'
export default buildConfig({
// ...
plugins: [
contactPlugin({
notificationEmail: '[email protected]',
}),
],
})
The plugin adds a contact-messages collection and a contact-settings global. Generate
and run a migration:
payload migrate:create contact_plugin
payload migrate
The expected tables are contact_messages (with an enum_contact_messages_status enum
and a payload_locked_documents_rels.contact_messages_id FK) and contact_settings.
import { ContactForm } from '@navanem/payload-contact/client'
export default function ContactPage() {
return <ContactForm successMessage="Thanks — I'll get back to you by email." />
}
The form POSTs JSON to the plugin's endpoint:
POST /api/contact-api/submit { name, email, subject?, message, company? } -> { ok: true }
company is the honeypot field (kept hidden by the component). The endpoint path lives
under /contact-api/* — not the collection slug — so it never collides with the
contact-messages REST namespace.
contactPlugin(options) — all options are optional:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Accept new submissions (runtime-overridable via the settings global). |
minLength | number | 10 | Minimum message length. |
maxLength | number | 5000 | Maximum message length. |
requireSubject | boolean | false | Require the subject field. |
blockedKeywords | string[] | [] | A message containing any of these is dropped as spam. |
notificationEmail | string | '' | Stored for future email notifications (no email is sent without an adapter). |
successMessage | string | sensible default | Shown to the visitor after a successful submission. |
rateLimit | { windowMs: number; max: number } | { 60000, 3 } | Per-IP sliding-window limit. |
messagesSlug | string | contact-messages | Slug for the inbox collection. |
ipSalt | string | CONTACT_IP_SALT env | Salt for hashing IPs in the rate limiter. |
disabled | boolean | false | No-op (collection + global still registered so the schema stays stable). |
A Contact Settings global appears in the admin (group "Contact"). An admin can toggle the form on/off, change the min/max length, require a subject, edit the blocked keywords, and set the success message — applied immediately, no redeploy. The endpoint and the page fail open to the plugin options if the global has never been saved.
/admin/contact-inbox) — KPIs, period filters and a recent table.if (!req.user) return null) so message data
never leaks into unauthenticated SSR output.<ContactForm /> is a client component styled with a CSS module using --pc-* custom
properties (with sensible defaults), so you can theme it by overriding those variables.
| Prop | Default | Description |
|---|---|---|
successMessage | a default thank-you | Shown after submit. |
disabled | false | Render a "closed" notice instead of the form. |
endpoint | /api/contact-api/submit | Submit URL. |
className | — | Extra class on the root element. |
Off by default — messages always land in the inbox. To also get emailed on each new
message, open Contact Settings in the admin, expand Email notifications, tick
"Send an email on each new message", and fill in the recipient + SMTP host/port/user/
password/TLS/from. An afterChange hook then sends via nodemailer
on every new submission. The SMTP credentials live on an admin-read-only global, so
they never reach the client.
Use Node.js 22.12+ in the 22.x line, 24.x, or 26+, and pnpm 11.11.0 (the version used by CI).
pnpm install --frozen-lockfile
pnpm dev # boots a sqlite-backed Payload admin with the plugin registered
The dev environment lives in dev/ (sqlite, schema auto-push — no migrations needed).
pnpm test # run the vitest suite once
pnpm test:watch # watch mode
pnpm build # compile the plugin and copy its assets
Tests live in tests/ and exercise the plugin's pure and server logic through a fake
payload object, plus the development collection's unlock rule through Payload's real
access evaluator. No database is required to run them.
See SECURITY.md for the temporary Payload account-unlock mitigation and the remaining upstream advisory.
docs/configuration.md — plugin options, runtime settings, env varsdocs/frontend-integration.md — <ContactForm/>, endpoint, themingdocs/inbox-and-triage.md — the inbox, statuses, email notificationsMIT © navanem · www.navanem.com
form builder
Let admin editors build and manage forms from within the Payload admin panel
100171.2k/wk46.1kv3 v4
payload forms
Visual drag-and-drop form builder with submissions, email notifications and CSV import/export
3639/wk5v3
payload plugin contact tiles
Routed contact page with topic autocomplete, quick tiles and one form that emails the topic's group address
74161/wk0v3
payload recaptcha v3
Protect collection operations with Google reCAPTCHA v3 token verification
37183/wk37v3
payload plugin wizards
Gated step-by-step wizards with admin-edited steps and server-verified, recorded answers
64193/wk0v3
form builder app 1 2025
Next.js and Payload app using the form builder plugin to create forms and accept submissions with file attachments
151/wk7v?