Retrieve select option value in webform-mail.tpl.php (7.x-4.x-dev) I have a custom mail template in Webform so values can be in a table for copying/pasting into Excel.

I want the value of the select option fields instead of the key (doing manual entry for webform creators would be too tedious). I can't seem to get to those values.

Any help would be appreciated.

Here's my current code for webform-mail.tpl.php:

&lt;h2&gt;
&lt;?php
    print $node-&gt;title;
?&gt;
&lt;/h2&gt;

&lt;?php print ($email['html'] ? '&lt;p&gt;' : '') . t('Submitted on [submission:date:long]'). ($email['html'] ? '&lt;/p&gt;' : ''); ?&gt;

&lt;table style="border: 1px solid black; border-collapse: collapse;"&gt;
&lt;?php
foreach ($node-&gt;webform['components'] as $key =&gt; $component) {
    if (isset($submission-&gt;data[$key][0])) {
   $key_converted = ucwords(str_replace('_',' ', $node-&gt;webform['components'][$key]['form_key']));
    print '&lt;tr&gt;&lt;td style="border: 1px solid black;"&gt;'. $key_converted .'&lt;td style="border: 1px solid black;"&gt;' . ($submission-&gt;data[$key][0]) . "&lt;/td&gt;&lt;/tr&gt;";
}
}
?&gt;
&lt;/table&gt;
For anyone else that runs across this:

&lt;h2&gt;
&lt;?php
print $node-&gt;title;
?&gt;
&lt;/h2&gt;

&lt;?php print ($email['html'] ? '&lt;p&gt;' : '') . t('Submitted on [submission:date:long]'). ($email['html'] ? '&lt;/p&gt;' : ''); ?&gt;


&lt;table style="border: 1px solid black; border-collapse: collapse;"&gt;
&lt;?php
foreach ($node-&gt;webform['components'] as $key =&gt; $component) {
   if (isset($submission-&gt;data[$key][0])) {
     $key_converted = ucwords(str_replace('_',' ', $node-&gt;webform['components'][$key]['form_key']));
     $submittedvalue = $submission-&gt;data[$key][0];

     if (isset($submittedvalue)) {
       print '&lt;tr&gt;&lt;td style="border: 1px solid black;"&gt;'. $key_converted .'&lt;/td&gt;&lt;td style="border: 1px solid black;"&gt;';
       if ($node-&gt;webform['components'][$key]['type'] != "select") {
           print $submittedvalue;
       }
       else {
        $selectlistitems = explode("|", $node-&gt;webform['components'][$key]['extra']['items']);
        if (is_numeric($submittedvalue)) {
                print $selectlistitems[$submittedvalue];
        }
        else {
                 print $submittedvalue;
        }
       }
       print '&lt;/td&gt;&lt;/tr&gt;';
       }
  }
}
?&gt;
&lt;/table&gt;