Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get default value output not message output #17

Open
bh-teufels opened this issue Apr 22, 2022 · 10 comments
Open

Get default value output not message output #17

bh-teufels opened this issue Apr 22, 2022 · 10 comments

Comments

@bh-teufels
Copy link
Contributor

bh-teufels commented Apr 22, 2022

Hello

i get the default "all values" output not my output defined in "Mail Text".
i debugged EMailFinisher.php and inside initializeStandaloneView & initializeFluidEmail the $message is the correct one.

seems that the EMail Template not using the one from your Extension i tried to override the Template in my own config but not working either.

finishersDefinition:
            EmailToSender:
              options:
                templateRootPaths:
                  20: 'EXT:form_mailtext/Resources/Private/Frontend/Templates/Finishers/Email/'
                  99: 'EXT:my_ext/Resources/Private/Overrides/form/Frontend/Templates/Finishers/Email/'
              # Extra field 'message' in finisher config in form plugin
              FormEngine:
                elements:
                  message:
                    label: 'formEditor.elements.Form.finisher.EmailToSender.editor.message.label'
                    config:
                      type: text
                      enableRichtext: true
                      eval: required
              formEditor:
                predefinedDefaults:
                  options:
                    message: "Hi, here's your input: {variables}"
            EmailToReceiver:
              options:
                templateRootPaths:
                  20: 'EXT:form_mailtext/Resources/Private/Frontend/Templates/Finishers/Email/'
                  99: 'EXT:my_ext/Resources/Private/Overrides/form/Frontend/Templates/Finishers/'
              # Extra field 'message' in finisher config in form plugin
              FormEngine:
                elements:
                  message:
                    label: 'formEditor.elements.Form.finisher.EmailToReceiver.editor.message.label'
                    config:
                      type: text
                      enableRichtext: true
                      eval: required
              formEditor:
                predefinedDefaults:
                  options:
                    message: "Hi, here's the users input: {variables}"

Typo3: 11.5.9
form_mailtext: 2.1.2
PHP: 7.4.3

@bh-teufels
Copy link
Contributor Author

if i copy your Default.html Template in own override Folder and rename it (eg.: Contact.html) and set templateName in Form Configuration (templateName: Contact)
it is working.

@kitzberger
Copy link
Owner

@bh-teufels, thanks for reaching out!

That's odd ;-/ The default templateName for the two finishers EmailToReceiver and EmailToSender is Default, see https://github.com/TYPO3-CMS/form/blob/main/Configuration/Yaml/Finishers/EmailToReceiver.yaml#L10

Maybe you have had that changed to Contact in your config somewhere else than the snippet from aboe? In that case you obviously need to provide a template with that name. Which you did ;-)

@bh-teufels
Copy link
Contributor Author

No i changed the templateName only when it didn't work .
before i copied your Default.html Template File i also tried with templateName: Default in my configuration an not copy the Template File but that has not worked either.

@kitzberger
Copy link
Owner

@bh-teufels, what TYPO3 version you're on?

@bh-teufels
Copy link
Contributor Author

i am on the latest 11.5.9
PHP 7.4
form_mailtext 2.1.2

@kitzberger
Copy link
Owner

@bh-teufels, I've just had a go with those versions and it's all working smoothly.

How's your TypoScript setup looking like?

plugin.tx_form {
    settings {
        yamlConfigurations {
            ???
        }
    }
}

Maybe there's an index conflict with your custom configuration? This extension here is using index 100.

@bh-teufels
Copy link
Contributor Author

i using index 110

plugin.tx_form {
settings {
yamlConfigurations {
# index '100' reserved by form_mailtext
110 = EXT:my_ext/Configuration/Form/BasicContactFormSetup.yaml
}
}
}

@kitzberger
Copy link
Owner

@bh-teufels, what happens when you use 20 instead?

@bh-teufels
Copy link
Contributor Author

so using am index lower than 100
i don't know have to try it.
but I won't be able to check it this week

@medarob
Copy link

medarob commented Aug 9, 2022

I think I experienced the same/similar problem in TYPO3 10.4 (currently on TYPO3 10.4.27).

Problem: I was wondering why the E-Mail from the form was empty.

In BE form editor
When I add {variables} into the new message field then it works but I think that shouldn't be necessary?

When I tried to delete the {variables} value again I got the error that the form is not correctly configured.
grafik

Setup.yaml

TYPO3:
  CMS:
    Form:
      persistenceManager:
        allowedExtensionPaths:
          10: EXT:my_extension/Resources/Private/__Form/
        allowSaveToExtensionPaths: true
        allowDeleteFromExtensionPaths: true
      prototypes:
        standard:
          formElementsDefinition:
            Form:
              renderingOptions:
                templateRootPaths:
                  150: 'EXT:my_extension/Resources/Private/__Form/Templates/'
                partialRootPaths:
                  150: 'EXT:my_extension/Resources/Private/__Form/Partials/'
                layoutRootPaths:
                  150: 'EXT:my_extension/Resources/Private/__Form/Layouts/'
          finishersDefinition:
            EmailToSender:
              formEditor:
                predefinedDefaults:
                  options:
                    message: "{variables}"
            EmailToReceiver:
              formEditor:
                predefinedDefaults:
                  options:
                    message: "{variables}"

grafik

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

No branches or pull requests

3 participants