By paul-c on
Hi,
I have a webform mail.tpl.php set up to customize the display of email sent once a webform on the site is submitted. I'm using code like this to display the submitted data in the template:
(Preferred Starting Date: <?php echo $form_values['submitted'][1]; ?>
Which works fine unless the submitted field is from a multi-select list or a date, in which case the email shows the submitted field as
(Preferred Starting Date: Array)
What do I need to use instead of $form_values['submitted'][field_id] to get the array values to display in the email message?
Thanks!
Comments
Bumping this - any
Bumping this - any ideas/suggestions?
use print_r($array) to see
use print_r($array) to see the full structure of your array so you know what to print
result of print_r
This is what I have added to my mail template file.
<?php print $form_values['submitted']['23']; ?>Which returns
Deserts: Arrayin the email that is sent.
So what I did was
<?php print_r($form_values['submitted']['23']); ?>Which returns the following in the email that is sent:
Which is the closest I have come to printing the actual selected values from the form. I have tried all of the various strings that I could find in the forums asked on IRC I am at a loss. :( It is amazing how something that should be completely mundane and simple is made to be so seemingly impossible to overcome. Sadly it is fragmented modules like Webform that bring Drupal down a notch.
If someone knows what php string I need to use to get the array of selected items to be properly displayed in the email I would really appreciate it. In fact I would be willing to pay $20 for the correct working solution. :)
Try something like
Try something like this:
Yup this worked perfectly
And the $20 goes to pfrenssen. Thank you so very much.
<?php echo