Forums / Setup & design / Enhanced Selection as recepient for feedback form
laurent le cadet
Thursday 21 September 2006 6:09:21 am
Hi,
I'm have a class (a feedback form) with the Enhanced Selection datatype. 4 items in a single choice list :
Europe Asia AfricaUSA
I want to associate those geographical area with a e-mail address to use this address as recipient.
I looked in the standard feedback_form.tpl:
{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}
and tryed this:
{set-block scope=root variable=email_receiver} {switch match=$object.data_map.geographical_area.content} {case match="Europe"} first@domain.com {/case} {case match="Asia"} second@domain.com {/case} {case match="Africa"} third@domain.com {/case} {case match="USA"} fourth@domain.com {/case} {/switch} {/set-block}
But this doesn't seems to work as this is the .ini default AdminEmail which is used.
Any hint ?
Reagrds.
Laurent
Thursday 21 September 2006 6:38:02 am
as is an array, I also tryed this :
{set-block scope=root variable=email_receiver} {let selected_id_array=$node.object.data_map.zone_geographique.attribute.content} {section var=Options loop=$node.object.data_map.zone_geographique.attribute.class_content.options} {section show=$selected_id_array|contains( $Options.item.id )} {switch match=$Options.item.id} {case match=0}first@domain.com{/case} {case match=1}second@domain.com{/case} {case match=2}third@domain.com{/case} {case match=3}fourth@domain.com{/case} {case}{/case} {/switch} {/section} {/section} {/let} {/set-block}
Till no result :(
Thursday 21 September 2006 7:17:25 am
based on ezenhancedselection.tpl :
{let selected_id_array=$node.object.data_map.zone_geographique.attribute.content selected_array=array()} {section name=Option loop=$node.object.data_map.zone_geographique.attribute.class_content.options} {section-exclude match=$selected_id_array|contains($Option:item.identifier)|not} {$Option:item.name|wash(xhtml)}{delimiter}{cond($node.object.data_map.zone_geographique.attribute.class_content.delimiter|ne(""),$node.object.data_map.zone_geographique.attribute.class_content.delimiter,", ")}{/delimiter} {/section} {/let}
But I always have the first item of the list even if it's another one that is choiced.
:(((
Thursday 21 September 2006 8:06:05 am
pfuuuu...
{let email=$collection.attributes[9]} {switch match=$email.data_text|wash(xhtml)} {case match="Europe"}{set-block scope=root variable=email_receiver}europe@domain.com{/set-block}{/case} {case match="USA"}{set-block scope=root variable=email_receiver}usa@domain.com{/set-block}{/case} {case match="Asia"}{set-block scope=root variable=email_receiver}asia@domain.com{/set-block}{/case} {case match="Africa"}{set-block scope=root variable=email_receiver}africa@domain.com{/set-block}{/case} {/switch} {/let}
It wasn't so hard Laurent !
Hope this help.