Closed tillschweneker closed 2 years ago
@tillschweneker, please have a look at the first draft of that feature. It's based on regex though I doubt it already supports nested conditions.
@kitzberger It works 🎉
Nesting is not working (as expected) and it is not easily possible to check if a value is empty.
@tillschweneker, I've just added comparisons with empty values and 'in array'. What do you think?
@kitzberger It works like a charm 🤙
Now we just need nesting and maybe an {else} part. #gettinggreedy
Oh @kitzberger, I missed something and I don't know if it has anything to do with the current changes. When I place {multiselect-1} in the mail output (not in an if condition) I get this error:
@tillschweneker, {else}
should be easy to implement, but nested conditions, phewww ;-(
No nesting is no problem @kitzberger
When I place {multiselect-1} in the mail output (not in an if condition) I get this error:
guess that's due to multiselect-1 being an array. you need to run it through some kind of foreach-thiny... that we don't have (yet)
@tillschweneker, 'else' is now implemented.
@kitzberger Nice one! It works as well. I think we are done, are we?
@tillschweneker, just released version 2.1.0 on packagist and TER. Thanks for your input ;-)
When using the extension it is possible to return the content of single form fields by adding the form field identifier to the mail text, e.g.
Hello Mr./Mrs. {text-1}
To allow the editors to create dynamic mail texts, based on the users' input, it would be nice to be able to conditionally output text, based on the content of an input variable.
The examples are based on the handlebars syntax, maybe fluid conditions are easier to implement, though.
The conditions should handle values from text fields, select fields, checkboxes and radio buttons. They should allow nesting as well, e.g.
Example:
The form has the following fields:
text-1
text-2
text-3
email-1
checkbox-1
The editor wants to send a dynamic text to the user, based on the filled out form fields.
Mailtext: