form icon indicating copy to clipboard operation
form copied to clipboard

FEATURE: Allow Eel-Helper in AbstractFinisher for parseOption()

Open erkenes opened this issue 2 years ago • 1 comments

Allows the usage of a Eel-Helper in the parseOption-Function This is useful if you have a form and want to send an email to different recipient-addresses based on the configuration context

erkenes avatar Sep 15 '22 09:09 erkenes

This improvement adds the support for eel-helpers in finishers. You can use it i. e. in an email finisher:

finishers:
  -
    identifier: 'Neos.Form:Email'
    options:
      subject: "${Configuration.setting('Foo.Bar.Site.Forms.ContactForm.subject')}"
      recipientAddress: "${Configuration.setting('Foo.Bar.Site.Forms.ContactForm.recipientAddress')}"
      recipientName: "${Configuration.setting('Foo.Bar.Site.Forms.ContactForm.recipientName')}"
      senderAddress: '{email}'
      senderName: '{name}'
      replyToAddress: '{email}'
      format: 'plaintext'
      allowEelParsingForOptions:
        subject: true
        recipientAddress: true
        recipientName: true
      testMode: true

And change the options dynamically with the settings:

# Packages/Sites/Foo.Bar.Site/Configuration/Settings.yaml
Foo:
  Bar:
    Site:
      Forms:
        ContactForm:
          recipientAddress: '[email protected]'
          subject: '[DEV] Contact Form'
          recipientName: 'Your Dev Name'
# Configuration/Production/Settings.yaml
Foo:
  Bar:
    Site:
      Forms:
        ContactForm:
          recipientAddress: '[email protected]'
          subject: 'Contact Form'
          recipientName: 'Foo-Bar Support'

erkenes avatar Sep 15 '22 09:09 erkenes