+ # search for the template
+ my ($template_file, @template_files) = SL::Helper::CreatePDF->find_template(
+ name => $print_form->{formname},
+ email => $print_form->{media} eq 'email',
+ language => $params->{language},
+ printer_id => $print_form->{printer_id}, # todo
+ );
+
+ if (!defined $template_file) {
+ push @errors, $::locale->text('Cannot find matching template for this print request. Please contact your template maintainer. I tried these: #1.', join ', ', map { "'$_'"} @template_files);
+ }
+
+ return @errors if scalar @errors;
+