Feature #81593

Usage of constants in YAML files

Added by Wolfgang Freund 3 months ago. Updated 9 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2017-06-16
Due date:
% Done:

0%

PHP Version:
7.1
Tags:
Complexity:
Sprint Focus:

Description

Are there any plans, or is it already possible to use constants in the FormDefinition YAML?
As for the email finishers i have to hardcode for example the recipientAddress.

As I work with different environments, mails should be sent to different recipients depending on the environment.

So it would be nice if following logic in the basic finishers would be possible:

finishers:
  -
    identifier: EmailToReceiver
    options:
      subject: 'Message form website'
      recipientAddress: {$my_site_package.fom.contact.recipient.email}
      recipientName: {$my_site_package.fom.contact.recipient.name}
      senderAddress: {$my_site_package.fom.contact.sender.email}
      senderName: {$my_site_package.fom.contact.sender.name}
      replyToAddress: '{email}'
      carbonCopyAddress: ''
      blindCarbonCopyAddress: ''
      format: html
      attachUploads: 'false'
      translation:
        language: 'en'

History

#1 Updated by Christoph Bessei 3 months ago

Did you try TypoScript overrides? https://docs.typo3.org/typo3cms/drafts/code.tritum.de/TYPO3.CMS/Form_Documentation/Concepts/Index.html#typoscript-overrides
It's not exactly what you want, but sounds useful and I guess you could use constants there.

#2 Updated by Wolfgang Freund 3 months ago

Yes already tried that. For me the approach with constants within the YAML file feels cleaner.
Nevertheless I tried some finisher overrides (for example the mail subject) and it does not seem to work in all cases...

#3 Updated by Denis Mir 9 days ago

The TS overrides are ok but constructs like

plugin.tx_form {
  settings {
    formDefinitionOverrides {
      SomeForm {
        renderables {
          0 {
            renderables {
              4 {
                properties {
                  privacyPageUid = {$plugin.someExt.general.privacyPagePid}
                }
              }
            }
          }
        }
      }
    }
  }
}

are not really nice since you have to hard code the indexes in the array which fail when something gets added in between in the configuration file. It would be a lot better to be able to use TS constants in the YML file.

Also available in: Atom PDF