The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Display text for checkbox group not being passed to email - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Display text for checkbox group not being passed to email (/showthread.php?tid=1402) |
Display text for checkbox group not being passed to email - wavesource - Jun 23rd, 2011 Not sure if this is my misconfig or a bug/feature of FormTools: I've set up a checkbox group which collects values like lt_ffel_fff|lt_fdir_ddd|lt_fout_fff|lt_plus and set the corresponding display text to something more legible for the clients eg. Loan Type External, Loan Type Internal etc. and while viewing the submissions in FormTools is perfect, with the checkboxes displayed with display text, I see the email notifications coming through with just the raw data, eg. Loan Type lt_ffel_fff|lt_fdir_ddd|lt_fout_fff|lt_plus I have changed the data array delimiter for the whole script to be pipe, as you can see - has this screwed with the display text being set in the email template? Or...? RE: Display text for checkbox group not being passed to email - Ben - Jun 26th, 2011 Good question! Yeah, it looks like that's what's happening. But you can fix this like so. Just do a little conversion in your email template: Code: {assign var=arr value="|"|explode:$ANSWER_field1} (Assuming that $ANSWER_field1 refers to your checkbox field). Hope this helps. - Ben RE: Display text for checkbox group not being passed to email - wavesource - Jun 26th, 2011 Hi Ben I've placed your string into the template thus: {if $ANSWER_loan_type} <tr> <td style="font-weight: bold">Loan Type</td> <td>{assign var=arr value="|"|explode:$ANSWER_loan_type} {", "|implode:$arr}{$ANSWER_loan_type}</td> </tr> {/if} Not getting any changes - have I interpreted your directions correctly? Cheers David RE: Display text for checkbox group not being passed to email - Ben - Jun 27th, 2011 Almost... but weird you're not seeing the comma delimited output. I just tested it locally and it works fine for me. Change it to this: Code: {if $ANSWER_loan_type} That should only output the comma-delimited value, not the original value. I have to ask: are you sure the submission you're testing with has a value in that field? - Ben RE: Display text for checkbox group not being passed to email - wavesource - Jun 30th, 2011 Code: {if $ANSWER_loan_type} Yep, it definitely has a values in the field - and it's definitely not responding - just tightened and checked the template, this is in place: Code: {if $ANSWER_loan_type} Outputs to email thus: Code: Loan Type lt_ffel_fff, lt_fdir_ddd, lt_fout_fff, lt_plus Field option group is set up OK - see screenshot - *shrug* RE: Display text for checkbox group not being passed to email - Ben - Jul 1st, 2011 Good GRIEF, this is actually a bug with 2.0.6 - how remarkable. You're not doing anything wrong - the email template is just being passed the raw values; not the actual display values. Let me think about this. - Ben RE: Display text for checkbox group not being passed to email - Ben - Jul 1st, 2011 Well! That was surprising. So yeah, there's a bug in the code that's just outputting the values - not the display values. Astonishing no-one's mentioned it...! I'm not going to release a patch release for this, though. It'll be fixed in 2.1, but I won't release 2.0.7 just to fix this one issue. However, to fix it in your case, just replace the _ft_get_placeholder_hash() function on line 1345 of /code/emails.php with this code: Code: /** That should fix it up! Let me know if you continue to have problems. - Ben RE: Display text for checkbox group not being passed to email - wavesource - Jul 1st, 2011 Hi Ben Your code hack did the trick - multi-variable fields are now printing out one variable per line in emails with display text OK - it's a beautiful thing: Quote:Loan Type Thanks a bunch! David RE: Display text for checkbox group not being passed to email - Ben - Jul 8th, 2011 No worries, glad it's working now. ![]() - Ben |