Forms and engagement
Choose a native block for visitor messages and feedback so the CMS can handle submission, permissions, and moderation.
Messages and forms
- Use Alert to show a notice.
- Use Contact Form to collect messages. See Contact forms and messages for site settings and handling submissions.
Ratings and comments
- Rating collects star ratings.
- Comments displays approved comments and can accept new ones. See Engagement administration for moderation.
Browse the full forms and engagement reference. Back to Inventory.
Pattern, Form, And Engagement Blocks
alert — Alert
| Contract area | Source-backed behavior |
|---|---|
| Editable content | translations.title, required translations.content. |
| Settings and variants | settings.variant: info, success, warning, danger. |
| Children/media | None. |
| HTML | Generic wrapper plus <div class="wb-alert wb-alert-{tone}"> and optional title. |
| Example appearance | Inline warning, success note, or informational message. |
| Avoid | Marketing promos. |
contact_form — Contact Form
| Contract area | Source-backed behavior |
|---|---|
| Editable content | Locale-owned title, content, submit_label, success_message, consent_label. Consent wording is writable through content plans, page/shared-slot block creation, and flat or family-nested block translation PATCH. Omitted PATCH wording is preserved; an explicitly blank consent_label clears only that locale when consent is optional. Required consent refuses missing, null, empty or whitespace-only wording on editor saves, API creation and translation PATCH before persistence. Creating a new locale row requires its own notice; omitting the field preserves an existing notice. Staged creation and promotion preserve wording in all locales. |
| Settings and variants | recipient_email; send_email_notification; store_submissions remains product-owned true in the native contract; consent_required (boolean, default false); optional shared privacy_notice_url (internal path starting with / or valid HTTP(S) URL, max 2048 characters). |
| Privacy notice link | Set settings.privacy_notice_url independently of consent. A separate link uses the visitor locale's built-in label; internal page paths resolve through that same site's page translations, preserving query/fragment and the existing stored-URL fallback when unresolved or untranslated. External HTTP(S) URLs stay unchanged. Empty/null hides the link. Editor and API creation/PATCH validate the URL; omission on update preserves it, blank/null clears it. Nondefault-locale editor saves preserve this shared value. Unsupported schemes, protocol-relative URLs, credentials, controls and backslashes are refused; invalid historical URLs render no link. The URL uses a declared typed SQL field in live settings and complete revision snapshots and survives staging/promotion. It neither enables consent nor records acceptance or the linked page's content/version on a message. |
| Publication validation | Publishing a page, a block, page-owned blocks or a staged update checks required notices in every enabled site locale; a site with no locale assignments still checks the default locale. An absent locale row uses the existing default-row fallback; an existing blank row is invalid. Page publication checks visible published blocks and active Shared Slots; optional page-owned-block publishing also checks draft/in-review candidates. Disabled slots and unpublished ancestors do not affect page-only publication. Publishing a parent cannot expose an invalid descendant. Promotion checks selected replacement slots and the untouched live scope; failures leave source/stage/status/revisions unchanged. Active Shared Slot restoration/activation and live slot source changes use the same guard. Complete old revisions can be inspected as draft candidates, but invalid live restoration is refused transactionally. Existing broken forms can be repaired one locale at a time; enabling required consent on a published block checks every enabled locale. |
| Consent | Set consent_required and give the locale a consent_label to render a required consent checkbox. The wording is translated because it is the notice. An accepted submission stores consent_accepted_at plus a copy of the wording, so editing the block later cannot change what a past visitor is recorded as having agreed to. Required consent with missing, empty or whitespace-only wording for the resolved locale shows a localized unavailable warning and disables the submit button; the server rejects all submissions, even a forged acceptance value, before storage or notification. Message Technical details show the saved consent time and original wording, marking absent values as not recorded without inferring historical consent. consent_required is closed to PATCH: removing a legal notice from a live form is an operator decision. |
| Site notification policy | Contact forms and participating plugins share Site.notification_settings, read through GET /webadmin/api/sites/{site}/notifications (content.read) and changed through PATCH (site-settings.write, site-scoped). Fields: notification_mode (full, alert_only), notification_frequency (immediate, batched, daily), batch_minutes (1–60), daily_summary (boolean), summary_hour (0–23 in the site timezone). Omitted PATCH fields are preserved; invalid, null and unknown values are rejected. These are site settings, never block PATCH fields. |
| Notification privacy | alert_only has trusted site copy, counts and normal authenticated CMS inbox links only. No visitor name/address, subject/body, IP, browser information, source URL/referrer, visitor Reply-To, custom headers or attachments. Separate minimal mailables never receive visitor models. full retains detailed notifications, including detailed batches. Daily summaries always contain counts and protected links, including when the selected content mode is full. Plugins cannot override the site's privacy mode. |
| Notification timing | New sites default to alert_only, batched, ten minutes, a daily summary enabled at 09:00. Upgrade migrations preserve existing full/immediate behavior with summaries disabled. Batched contact mail sends the first alert immediately, then combines subsequent messages per site/channel/recipient. Live Chat batches per conversation so each conversation gets its first offline alert immediately. daily sends one combined summary per site/recipient/day; with daily_summary enabled, existing pending work is reminded daily. Read contact messages remain awaiting reply until replied/archived; spam/quarantined/archived and opted-out messages are excluded. |
| Delivery and plugin extension | webblocks:notifications:dispatch is registered every minute with the Laravel scheduler; hosts must run it and use a shared cache supporting atomic locks when running multiple workers. Enrollment stores site/channel/source identifiers and status only, with unique source keys; policy is re-read before delivery. Failures are generic and never automatically retried. Interrupted attempts become failed after 15 minutes. Terminal events and idle dispatch state are pruned after 30 days. GET exposes site-scoped message outcomes and latest daily-summary outcomes; the Site settings panel and existing inboxes show delivery state. Enabled plugins register a SiteNotificationChannel adapter through SiteNotificationChannels with its plugin handle, owning site-scoped sources, recipients, eligibility, detail mail and pending counts; disabled plugins are not dispatched. |
| Panel notifications | From CMS 1.96.0, the shared admin header links to the Dashboard notification panel using the WebBlocks UI wb-btn wb-btn-ghost wb-btn-icon action and wb-btn-badge counter. Visual counts are capped at 99+; the accessible label retains exact counts. Site-operation managers see aggregate unread (new) and awaiting-reply (new + read) contact-message counts for accessible sites, plus a scheduling warning when any accessible site requires scheduled email and recorded health is unverified, delayed, failed or unavailable. From CMS 1.97.0 the header badge counts unread contact messages only; read messages awaiting reply and scheduler/schema warnings remain separate Dashboard state and do not contribute to that badge. The navigation bell is rendered only when there are unread contact messages; zero unread messages hide the entire action, while the Dashboard notification panel remains available. The site-row Actions cell uses the standard WebBlocks UI view icon with translated tooltip and accessible label explaining that it opens messages awaiting reply. Stored work is visible independently of mail opt-in, recipient configuration, delivery outcome or scheduler evidence. No visitor names, addresses, subjects, contents or IPs enter the summary. Reads never send mail, consume events, mark messages read or establish scheduler health. Counts refresh on each panel page load; this is current shared inbox state, not a per-user notification history or automatic polling. Site links use GET /webadmin/contact-messages?site={id}; the scoped site selector is validated and preserved in safe inbox return URLs. Replied, archived, spam and quarantined messages are excluded; missing inbox schema shows a migration warning rather than an empty inbox. Live Chat retains its separate permission- and site-scoped plugin panel indicator, which also works without scheduled email. |
| Scheduler health and prerequisites | CMS 1.95.1 records an actual every-minute scheduled callback separately from notification-command starts/completions/failures in the CMS database. Site-policy-derived required is true for batched/daily delivery or daily summaries. The System Health scheduling section shows the full health notice, pending-delivery impact, last scheduled heartbeat and completed notification run in UTC, server-owned setup instructions, and a guide link resolved from the configured documentation root. Its aggregate scheduling Review link targets this section and preserves the selected site filter. The Dashboard retains the detailed notice with accessible-site links for site-operation managers without System Health access, including legacy immediate-only sites. Operators with System Health access instead see a compact Dashboard summary of critical, warning, and unknown checks using the same report and cache; zero issue counts show that no issues were found in the available checks. Warning severity depends on whether any accessible site requires scheduled notification delivery; inaccessible sites do not influence it. Immediate-only policies without daily summaries retain an informational status card explaining that scheduling is optional for those notifications; Site settings and the scoped notification GET API show scheduler_health with overall/scheduler/worker status and UTC timestamps. Missing evidence stays unverified; evidence older than 300 seconds is delayed; processing failures and unavailable schema are explicit; a current unfinished run can be running. Manual dispatch and health reads never create a scheduler heartbeat. The read-only webblocks:scheduler:status --json command exits successfully only for verified healthy status. Scheduler execution does not guarantee SMTP/inbox delivery or health of every node. Installer and guest setup notice explain working mail, canonical APP_URL, a server-owned every-minute scheduler, and shared atomic-lock cache for multiple workers; updates and web requests never install cron; CMS 1.105.25 adds the explicitly confirmed CLI setup described below. Enabled notification plugins may consume the same SchedulerHealth service in settings and health checks. |
| Contact Messages inbox | The status summary counts saved messages matching the active filters across all result pages. A separate collapsible Local protection section reports the last 30 days of contact form checks for the selected readable site or all readable sites. Those historical counts include checks for subsequently deleted messages and are independent of the message search, status and notification filters. Bulk Mark selected as read and Mark selected as unread move eligible selected messages between new and read. The server rechecks read and status-update access for each affected site, preserves other editorial statuses and email delivery state, and returns to the filtered inbox with the actual number updated. |
| Children/media | None. |
| HTML | Generic wrapper around native section.wb-card, CSRF-protected form, renderer-generated anti-spam field, WebBlocks inputs, textarea, optional consent checkbox, validation errors, and submit button. After submission, the browser returns to a success alert directly beneath the submit row of the submitted form. The localized confirmation is escaped as text, scoped to that block and shown inline on the return page without automatically disappearing. |
| Example appearance | Fully managed contact form stored in Contact Messages with optional notification. |
| Avoid | Raw form HTML, custom honeypot fields, or mailto: replacement. |
rating — Rating
| Contract area | Source-backed behavior |
|---|---|
| Editable content | Optional locale-aware heading and supporting text (title, subtitle) use text translations. Legacy settings.title remains a render fallback; normal labels are product-translated. |
| Settings and variants | scale: fixed 5; allow_change: boolean; show_summary: boolean; data_scope (CMS 1.97.0): block (default, preserves separate feedback areas) or page (same stored site/page, survives block replacement). Both editor and block PATCH support scope. |
| Children/media | Uses content_ratings; no children. |
| HTML | Root-owning <section class="wb-card"> with optional H3, partially filled .wb-rating-stars, summary, and no-JS .wb-rating-input submit buttons. |
| Example appearance | Five-star page rating with average and response count. |
| Note | Only active 5-point votes enter the public summary. Page scope keeps the visitor-session hash stable across block replacement, serializes writes under a page lock, and recognizes surviving block-scoped hashes for the current session. Orphaned legacy hashes cannot be matched or deduplicated automatically; existing rows remain unchanged until a recognized vote is updated. The form marks the current session vote with aria-pressed and disables repeat input when allow_change is false; the server also enforces it. GET does not create a visitor ID. |
comments — Comments
| Contract area | Source-backed behavior |
|---|---|
| Editable content | No block-authored visitor copy; product translations supply labels and messages. |
| Settings and variants | form_enabled, show_approved, show_author_name; sort_order: newest or oldest; data_scope (CMS 1.97.0): block (default) or page. Page scope includes approved records with the same persisted site/page, including records whose original block was deleted; neighboring pages and sites remain excluded. |
| Children/media | Uses moderated comment_entries; no children. |
| HTML | Root-owning <section class="wb-card wb-public-comments"> with separately labeled Comments/list and Leave a comment/form regions (CMS 1.97.1), localized product headings and an approved-count badge. Author/date share a wrapping metadata row; escaped multiline text uses compact spacing. The form has a theme-aware muted surface, a three-row textarea, and a compact name field that expands on phones. Retains 25-per-page pagination (comments_page_{block_id} with fragment and query preservation), native CSRF protection, anti-spam fields, targeted validation state, and submit action. List and form visibility remain independent. |
| Example appearance | Moderated comments below an article or product guide. |
| Avoid | Custom comment storage or raw form markup. |
Engagement administration
Approving an already approved comment in the panel or Internal Content API succeeds without changing the recorded approver or approval time. A transition into approval records the actor and time for that transition.
Engagement uses authorized site-scoped aggregates and a sortable, paginated page summary. The all-time pending-review queue and its oldest submission are distinct from new submission counts for the last 7 and 30 days. Ratings mean and distribution include only active 5-point votes; saved-record totals can include inactive or other-scale rows and do not represent unique people. Comments and Ratings share labeled site/page/date/search filters; Comments adds localized status filters and counts, while Ratings adds a value filter and separate submitted/updated dates. Ratings remain read-only with a public-page view icon. Full escaped comment content and spam reasons are available through a policy-guarded detail page. Standard WebBlocks UI action icons expose applicable moderation transitions; selecting comments supports up to 100 per atomic status mutation with policy checks for every record before any update. Mutations retain listing filters and pagination, with the shared out-of-range redirect handling a reduced result set. Reading panels does not moderate submissions or send mail, and needs no scheduler. Staged previews use their own persisted page identity; previously collected page-scoped results reappear after promotion onto the original page. Moderation permissions do not imply publication of a page.
Additional protected editorial forms (1.112.0)
New page creation, new page-owned block creation (slot workspace and standalone form), new page translations and existing translation/SEO forms use the same confirmed-checkpoint Save and one-use restore protocol. Existing page settings and existing block recovery retain their draft/staged scope. Additional forms follow their normal current workflow permissions, including already-authorized published-page block/translation operations; this adds no publication authority. Shared Slot/source pages and revision restore candidates, file uploads and credential fields remain excluded. New-page recovery requires page-create access and the site's enabled default locale. Block recovery requires a discoverable published block type, a published page-owned slot and an optional parent belonging to that page/slot. Translation recovery requires translation-update permission and an enabled site locale. SEO fields require the existing SEO permission. Account activity, grants and context are rechecked under shared ACL and ordered user/site/page locks before writes, restore and protected Save.
Headers gain a nullable page reference and typed form-kind, block-type, slot, parent, translation and completed page/block/translation references. No new JSON persistence is introduced. Unfinished new-page values create no page, block, translation or revision. New and existing recovery share the same seven-day lifetime, 32 active sessions, field/node/byte limits, pruning, owner/session uniqueness and relational value storage. Form kinds and every applicable context reference are matched before reading, restoring, clearing or saving; legacy page/block endpoints cannot read additional-form checkpoints. Changing a site's or block's context keeps current typing, stops obsolete listeners and switches recovery intent without accepting late responses from the old context. Until a complete valid context and server fingerprint are confirmed, protected Save remains blocked.
The existing page/block create and translation create/update routes return an explicit same-origin JSON receipt only for opted-in editor Save requests; ordinary native requests keep redirects. The editorial transaction clears only its matching checkpoint and records typed result references. After a lost success response, explicit retry reads the completion marker and opens the authorized saved record without issuing another creation request. Additional typing after such a save remains in the form for review, with a saved-record link. Opening a fresh create form rotates a completed editing intent. Discarded/expired intents cannot create content; cleared markers reject late writes. Successful Save removes recovery values while retaining the bounded completion marker until expiry. Restore tickets remain single-use and request-local; conflict review, CSRF, private no-store responses and current permissions remain mandatory.