Last active
November 7, 2023 10:48
-
-
Save kitzberger/7a53d517b5991769783fd7326062e157 to your computer and use it in GitHub Desktop.
TYPO3 form with dynamic recipients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
identifier: formWithDynRecipients | |
label: 'Form with dynamic recipients' | |
type: Form | |
prototypeName: standard | |
renderingOptions: | |
submitButtonLabel: Submit | |
finishers: | |
- | |
identifier: EmailToReceiver | |
options: &emailToReceiverOptions | |
subject: '{group} and {topic}' | |
recipients: | |
[email protected]: Default Recipient | |
senderAddress: '{email}' | |
senderName: '{name}' | |
format: html | |
attachUploads: true | |
translation: | |
language: default | |
useFluidEmail: true | |
title: 'Confirmation of your message' | |
- | |
identifier: Confirmation | |
options: &confirmationOptions | |
message: "Thanks for your message" | |
contentElementUid: '' | |
renderables: | |
- | |
renderingOptions: | |
previousButtonLabel: 'Previous Page' | |
nextButtonLabel: 'Next Step' | |
identifier: page-1 | |
label: '' | |
type: Page | |
renderables: | |
- | |
defaultValue: '' | |
identifier: name | |
label: 'Your name' | |
type: Text | |
properties: | |
fluidAdditionalAttributes: | |
placeholder: 'Your name' | |
required: required | |
elementDescription: '' | |
validators: | |
- | |
identifier: NotEmpty | |
- | |
identifier: Alphanumeric | |
- | |
defaultValue: '' | |
identifier: email | |
label: 'Your Email' | |
type: Text | |
properties: | |
fluidAdditionalAttributes: | |
placeholder: 'Your email' | |
required: required | |
elementDescription: '' | |
validators: | |
- | |
identifier: NotEmpty | |
- | |
identifier: EmailAddress | |
- | |
identifier: group | |
type: SingleSelect | |
label: 'group' | |
properties: | |
options: | |
group1: 'Group 1' | |
group2: 'Group 2' | |
group3: 'Group 3' | |
prependOptionLabel: '-- Please select --' | |
fluidAdditionalAttributes: | |
required: required | |
validators: | |
- | |
identifier: NotEmpty | |
- | |
identifier: topic | |
type: SingleSelect | |
label: 'Topic' | |
properties: | |
options: | |
topic1: 'Topic One' | |
topic2: 'Topic Two' | |
prependOptionLabel: '-- Please select --' | |
- | |
renderingOptions: | |
previousButtonLabel: 'Previous Page' | |
nextButtonLabel: 'Next Step' | |
identifier: summarypage | |
label: 'Summary page' | |
type: SummaryPage | |
variants: | |
- | |
identifier: group1 | |
condition: 'formValues["group"] == "group1"' | |
finishers: | |
- | |
identifier: EmailToReceiver | |
options: | |
<<: *emailToReceiverOptions | |
recipients: | |
[email protected]: '{group}' | |
- | |
identifier: Confirmation | |
options: | |
<<: *confirmationOptions | |
- | |
identifier: group2_and_topic1 | |
condition: 'formValues["group"] == "group2" && formValues["topic"] == "topic1"' | |
finishers: | |
- | |
identifier: EmailToReceiver | |
options: | |
<<: *emailToReceiverOptions | |
recipients: | |
[email protected]: '{group} {topic}' | |
- | |
identifier: Confirmation | |
options: | |
<<: *confirmationOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('TYPO3') || die('Access denied.'); | |
(function () { | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup( | |
trim(' | |
module.tx_form.settings.yamlConfigurations { | |
110 = EXT:my_extension/Configuration/Form/FormSetup.yaml | |
} | |
plugin.tx_form.settings.yamlConfigurations { | |
110 = EXT:my_extension/Configuration/Form/FormSetup.yaml | |
} | |
') | |
); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TYPO3: | |
CMS: | |
Form: | |
prototypes: | |
standard: | |
formElementsDefinition: | |
Form: | |
renderingOptions: | |
translation: | |
translationFiles: | |
20: EXT:my_extension/Resources/Private/Language/locallang_form.xlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | |
<xliff version="1.0"> | |
<file source-language="en" datatype="plaintext" original="messages" product-name="my_extension"> | |
<header/> | |
<body> | |
<trans-unit id="element.formWithDynRecipients.renderingOptions.submitButtonLabel"> | |
<source>Submit now</source> | |
</trans-unit> | |
<trans-unit id="formWithDynRecipients.element.page-1.properties.label"> | |
<source>Page one</source> | |
</trans-unit> | |
<trans-unit id="formWithDynRecipients.element.name.properties.label"> | |
<source>Your full name</source> | |
</trans-unit> | |
</body> | |
</file> | |
</xliff> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment