heimrichhannot/contao-submissions

A generic module to store and handle submissions in contao.

1.24.1 2024-03-21 14:50 UTC

README

A generic module to store and handle submissions in Contao. You can use it with all of your modules to simplify submission handling. Works great with heimrichhannot/frontendedit, heimrichhannot/formhybrid_list and heimrichhannot/formhybrid.

Screenshots

Features

  • a new submissions entity (organized in archives)
  • opportunity to specify a parent entity for each archive (e.g. an event)
  • submissions are highly customizable by defining new fields in your dca (palette is created with no code at all)
  • every archive can specify its own submission field list
  • rich interfaces (e.g. SubmissionModel)
  • handling for notification center messages (terminal42/contao-notification_center)
  • easily export submissions as CSV and Excel file (using heimrichhannot/contao-exporter)
  • optional cleaner support for periodically removing unpublished (aka inactive) submissions (using TL_CRON or your server's cron, using heimrichhannot/contao-entity_cleaner)
  • specify a member (frontend) or a user (backend) to be the author of the submission
  • Form generator support including opt-in process (contao 4.7+ only)

Install

  1. Install with composer or contao manager

    composer require heimrichhannot/contao-submissions

  2. Update database

Usage

You will find a new backend menu entry named "Submissions". Create a new archive with a title and select the fields, your submissions should contain.

Form generator

You can store your form generator submissions directly as submission. Just active "store as submission" and select the submission archive. Form field names must be the same as the fields names of the submission entity.

For submitted files form_attachment_*-Notification-Center-Tokens are generated.

If you on contao 4.7 or higher, you can also set up an double opt-in process for your submission. Create an opt-in notification in notification center and select it in the form configuration. You can also choose a jump to page to which the user is redirected when the opt-in-url is called and the opt-in was successful. If you want to check a property on successful opt-ins, you can set the confirmation field property (e.g. set the publish field to true).

You can use following notification tokens in the opt-in-notification:

Formhybrid

To use this bundle with formhybrid, we recommend to install Submissions Creator.

Further information

Fields

tl_submission:

Add custom fields

After adding new fields, run

\HeimrichHannot\Submissions\Backend\SubmissionBackend::addFieldsToPalette();

in your dca in order to add the new fields to the default palette.

tl_submission_archive

Developers

Events

These events are implemented as symfony events and only usable in contao 4+.

Hooks