TYPO3 Logo
Double opt-in for EXT:form
Options
Give feedback View source How to edit Edit on GitHub Full documentation (single file)

Double opt-in for EXT:form

  • Introduction
  • Installation
  • Configuration
    • Form finisher configuration
    • SiteSet configuration
    • TypoScript configuration
    • Extension configuration
  • Usage
    • Consent finisher
    • Validation plugin
    • Scheduler task
    • Dashboard widget
  • Developer corner
    • Configuration API
    • Consent factory
    • Events
    • JSON type
  • Migration
  • Contributing
  • Sitemap
  1. Double opt-in for EXT:form
  2. Usage
  3. Consent finisher
Give feedback Edit on GitHub

Consent finisher

A new finisher Consent is available in the backend form editor. It saves all submitted form data in the database and sends a corresponding mail to either approve or dismiss a given consent.

Tip

The last inserted consent is populated with the finisher variable provider. It can be accessed as {Consent.lastInsertedConsent} in the .form.yaml configuration.

Form editor with consent finisher options

Example

finishers:
  -
    identifier: Consent
    options:
      subject: 'Please approve your subscription'
      recipientAddress: '{email}'
      recipientName: '{first-name} {last-name}'
      senderAddress: ''
      senderName: ''
      replyToAddress: ''
      replyToName: ''
      approvalPeriod: '86400'
      showDismissLink: true
      confirmationPid: '277'
      storagePid: '276'
      requireApproveVerification: true
      requireDismissVerification: true
  -
    identifier: SaveToDatabase
    options:
      table: tx_myextension_domain_model_subscription
      mode: insert
      databaseColumnMappings:
        consent:
          # References the consent uid
          value: '{Consent.lastInsertedConsent.uid}'
Copied!

See also

Read more about all available finisher options in Form finisher configuration.

Invoke finishers on consent approval or dismissal

After a user has given or revoked consent, it is often necessary to execute certain form finishers. For example, to send an admin email or redirect to a specific page.

To achieve this, after the user gives or revokes consent, the originally completed form is resubmitted. During this resubmission of the form, the selected finishers can now be overwritten using the isConsentApproved() or isConsentDismissed() conditions in a form variant.

Requirements

The following requirements must be met for the form to be resubmitted:

  1. Form variant at the root level of the form must exist
  2. Form variant must redefine the finishers used
  3. Conditions isConsentApproved() or isConsentDismissed() must exist in the variant

Example

The following form variant is stored directly on the root level of the form definition (that is, your .form.yaml file). It specifies the form finishers to be executed in case of successful approval by the user.

variants:
  -
    identifier: post-consent-approval-variant-1
    condition: 'isConsentApproved()'
    finishers:
      -
        identifier: EmailToReceiver
        options:
          # ...
      -
        identifier: Redirect
        options:
          # ...
Copied!

In this example, an admin email would be sent after the consent has been given and a redirect to the configured confirmation page would take place.

The same behavior can be achieved in case the user revokes his consent. The condition isConsentDismissed() must then be used instead.

  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Home
  • Contact
  • Issues
  • Repository

Last rendered: Jun 22, 2025 21:30

© since 2021 by Elias Häußler
  • Legal Notice
  • Privacy Policy