I'm using conditional fields in this scenario, so only programs available at the selected location are included:
************
LOCATION (select options)
1|1... Enables ProgramList-1
2|2... Enables ProgramList-2
3|3... Enables ProgramList-3
************
The email subject needs to contain "%value[location] %value[program]". However, in order to account for all possible programs, it is "%value[location] %value[programlist-1] %value[programlist-2] %value[programlist-3]".
The problem is that only one program list will be completed on any form, so the subject always looks like "Location [programlist-1] Program [programlist-3]".
Is it possible to exclude the [key] when no value is entered?
Thanks in advance for any help you can offer!
Joy
Comments
Comment #1
quicksketchWebform should clean up the remaining part of the token for you if it's empty. It's strange that it would remove %value but not the part in brackets. This may be related to #1332820: Parts of nested tokens (in fieldsets) printed when left empty, but I'm not sure if it's the same problem or not. I haven't yet confirmed this problem, so it's possible that it's been fixed already in more recent releases of Webform.
Comment #2
quicksketchComment #3
sunshinee commentedquicksketch: This may be related to the issue you suggest, but we have not observed the tokens appearing in the body of the email, only the subject line. We are currently running 6.x-3.15, but plan to update to the latest release next week and will post back if the update resolves the problem.
Thanks for your time!
Comment #4
quicksketchHey @sunshinee, I saw you in the queue recently so maybe you'll be able to followup on this issue. At this point I'm tempted to mark this won't fix as 4.x moves to the final release, but did you ever find out if newer versions of Webform solved this problem? The current stable for 6.x is 3.20.
Comment #5
sunshinee commentedHi @quicksketch,
No, this never went away. It was a relatively low priority for us, so we ended up renaming the keys to make it a bit less awkward:
programlist-1 = your
programlist-2 = degree
programlist-3 = application
So the email subjects came out of webform like:
[your] Program [application] at Location
[your][degree]Program at Location
Program [degree] [application] at Location
Not the slightest bit elegant, but it appeased the masses. Given there are no other responses, I can't imagine this is more than an edge case--and a very minor issue at that. ;-)
Joy
Comment #6
danchadwick commentedThe 6.x branch is receiving critical bug fixes only.