I have a serverconnect form that must display a notification onsucces.
It works, but as soon as I add one or more dynamic form input field data inside the notification message it produces an error and the notification is not shown.
dmx-on:success="not_forminsert.success("Hartelijk dank {{geb_voornaam.value}} {{geb_achternaam.value}} voor uw aanmelding op de nieuwsbrief. <br>U kunt zich ten alle tijden via een link op de nieuwsbrief weer uitschrijven.")"
TypeError: undefined is not a function (near ‘…not_forminsert.success…’)
dmx-on:success="not_forminsert.success('Hartelijk dank '+geb_voornaam.value+' '+geb_achternaam.value+' voor uw aanmelding op de nieuwsbrief. <br>U kunt zich ten alle tijden via een link op de nieuwsbrief weer uitschrijven.')"
So basically each time you use LITERAL text then it needs to be wrapped in single quotes, even just a single LITERAL ’ ’ SPACE needs the single quotes.
When you want to break out of LITERAL to DYNAMIC DATA then you drop the single quotes and insert a + to add DYNAMIC DATA to the LITERAL data, and if you want more LITERAL text after the DYNAMIC, then you add another + with text after the plus in single quotes.
Thank you Paul, that works. I knew that was the right syntax, but since I used the the dialog from the notification plugin to add dynamic data I assumed Wappler had some magic to make it right.
Conclusion: @Teodor, @George inserting dynamic data in normal strings for notifications perhaps needs some formatting work.
@oscreative not sure what do you mean that it needs some formatting, but the static content must be wrapped in single quotes ‘static text’ while the dynamic data is just the expression without any quotes.
This has already been explained in the documentation wherever static and dynamic data is used.