I have a form where there are some optional fieldsets that are conditionally hidden/shown in the form based on responses to preceding questions. If the user doesn’t fill in the fieldset I’d like to hide those questions in the email response to both the recipient and the receipt.
Custom form HTML emails still don’t support conditional keywords (e.g. %begin_response_XXXX_qYY%[question code]%end_response_XXXX_qYY%). So, previously I’ve used one of the following methods to hide content in form response emails, which has worked fine for years.
It seems that since the upgrade to 5.4.3.1, Viper has gotten more fancy/officious with its rewriting of the HTML and now it breaks my email code.
The above code becomes the below code after you “Apply changes”
(Note the missing “%” from the end of the first line and the missing keyword (%response_XXXX_qYY^notempty:) from the start of the third line.
Yea, it’s a recurring problem, and we are looking at ways to make custom form email formatting a lot better.
But if you are storing the form submission assets in Matrix, you can use a PL to format the email contents. Simply just put this in the email contents: %form_submission_id^as_asset:asset_contents_paint_layout_id_1234% where 1234 is your PL, and then you can format it there using standard keyword modifiers and conditions. You just need to use the %question_answer_xxxx_qx% format to get the value of a form field.
Sorry for the slow reply, the project that this is important for only runs twice a year and I had to do without last time. It’s on again so now I can devote more time to it.
Hi @Bart I have tried this solution for one of our forms. It doesn’t work for the public users. I have tried giving read/write permissions to the public users for the form submissions but it still doesn’t work.
Is there a way we can make this PL solution working for public users as well?
@aforadeel My guess is that either your form (or paint layout) is in Safe Edit mode, your paint layout is still under construction or that the paint layout itself doesn’t have read permissions.
NOTE: it’s probably a bad idea to give the form public write access. (Sorry if I’ve misunderstood your comment “I have tried giving read/write permissions to the public users for the form submissions”)
It’s also possible that you haven’t got the paint layout keyword right. From memory, it took me a couple of goes to get it right. This is what I used in the email body:
to format the web form submission data but there is an issue. My form is a multi page form and it only pushing the form’s last page data. I am using the following keyword to print the data in the email.
%nested_get_data^json_decode^index:q1237436:q1%
Is there a way I can push the data of all the form pages to the standard page?
Multi-page forms make it a bit harder. Are you creating a form submission asset as part of the multi-step process? Then you should be able to use %form_submission_id^as_asset:asset_contents_paint_layout_id_2314291% method on the last confirmation step and get that in a hidden text field to get posted and then use %globals_get_post% ?
You could also look into using a trigger option using the form submission completed action and setting the value of the submission into a session var and potentially getting it that way using %globals_session_x%