Skip to content

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

Open
erkenes wants to merge 1 commit intoneos:mainfrom
erkenes:feat/ee-eel-helper
Open

FEATURE: Allow Eel-Helper in AbstractFinisher for parseOption()#164
erkenes wants to merge 1 commit intoneos:mainfrom
erkenes:feat/ee-eel-helper

Conversation

@erkenes
Copy link
Copy Markdown
Contributor

@erkenes erkenes commented Sep 15, 2022

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

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
Copy link
Copy Markdown
Contributor Author

erkenes commented Sep 15, 2022

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: 'dev-user@foo-bar.com'
          subject: '[DEV] Contact Form'
          recipientName: 'Your Dev Name'
# Configuration/Production/Settings.yaml
Foo:
  Bar:
    Site:
      Forms:
        ContactForm:
          recipientAddress: 'info@foo-bar.com'
          subject: 'Contact Form'
          recipientName: 'Foo-Bar Support'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant