diff --git a/includes/webform.submissions.inc b/includes/webform.submissions.inc index d588eca..5823a49 100644 --- a/includes/webform.submissions.inc +++ b/includes/webform.submissions.inc @@ -256,12 +256,20 @@ function webform_submission_send_mail($node, $submission, $emails = NULL) { // Load attachments for the e-mail. $attachments = array(); if ($email['attachments']) { - webform_component_include('file'); foreach ($node->webform['components'] as $component) { if (webform_component_feature($component['type'], 'attachment') && !empty($submission->data[$component['cid']]['value'][0])) { - $file = webform_get_file($submission->data[$component['cid']]['value'][0]); - if ($file) { - $attachments[] = $file; + if (webform_component_implements($component['type'], 'get_files')) { + $files = webform_component_invoke($component['type'], 'get_files', $submission->data[$component['cid']]['value']); + if ($files) { + $attachments += $files; + } + } + else { + webform_component_include('file'); + $file = webform_get_file($submission->data[$component['cid']]['value'][0]); + if ($file) { + $attachments[] = $file; + } } } }