I have a long form where the recipient doesn't have to answer all the questions. After a submit the recipient gets a copy of the form in his mailbox. Now I want only that he receives the filled fields, because that's what he did. And it's user friendly.
Is there a way to achieve this?
I'm using CMS 2.2.12 and Formbuilder 0.8.1.6.
Formbuilder: how to only show the filled fields
Re: Formbuilder: how to only show the filled fields
The emails sent by Formbuilder are parsed by Smarty so you can use its logic to show or hide whatever you chose. It only depends on what a field holds when not filed. If it's just empty then you can use something like if it holds a default value or [unspecified] you just check for equalityetc...
Keep in mind that $fieldalias is just an example you'll need to use your field names or alias as you use them in your template
Code: Select all
{if !empty($fieldalias)}you submited {$fieldalias}{/if}Code: Select all
{if $fieldalias != '[unspecified]'}you submitted {$fieldalias} as your answer{/if}Keep in mind that $fieldalias is just an example you'll need to use your field names or alias as you use them in your template
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Formbuilder: how to only show the filled fields
Thanks Jo Morg for you quick reply. I'll let you (and others) know if it worked.
Re: Formbuilder: how to only show the filled fields
Hallo Jo Morg,
I can't figure out your answer. My code is. Where does your code fit in, if I want that in the mail the recipient doesn't see anything?
I can't figure out your answer. My code is
Code: Select all
<tr><td>{if $fld_91 != "" && $fld_91 != "[niet opgegeven]" }Overige opmerkingen:</td><td> {$fld_91}{/if}</td></tr>Re: Formbuilder: how to only show the filled fields
It's solved. Only the filled fields are showing in the recipients mail. Thanks for your help


