I created a plugin that fills form values into a pdf file.
What I would like to do now, is passing the filename to the thankyou page and attach the file to an email sent by the email plugin. Both should be configured in the form.md file as actions.
All form values are available as Twig variables in the thankyou page. All you need to do is set Twig processing to enabled in the frontmatter of the thankyou page like this:
YAML
cache_enable:falseprocess:twig:true
Disabling the cache for this page is a kind of precaution. Maybe it's needed, maybe it's not.
Then in the markdown of the thankyou page you do:
TWIG
{{form.value('filename_of_the_pdf')}}
For sending the email you can 'invent' some custom action and handle it in your plugin.
But I obviously forgot to mention that the filename must be unique, so I have to tell the thankyou page somehow the filename (generated at runtime by the 'invented' custom action) OR I use unique_id or form-nonce.
I see the latter id's in the debugging session but not within the data-array. How can I make use of this ( {{ forms.unique_form_id }} would be nice)?