diff --git a/webform2pdf.module b/webform2pdf.module
index a18f81c..4a65119 100644
--- a/webform2pdf.module
+++ b/webform2pdf.module
@@ -580,7 +580,7 @@ function webform2pdf_mail_alter(&$message) {
         if (webform_email_html_capable()) {
           if (module_exists('mimemail')) {
             $attachment = new stdClass;
-            $attachment->filecontent = theme('webform2pdf_mail2pdf', $webform2pdf_send2pdf['nid'], $webform2pdf_send2pdf['sid']);
+            $attachment->filecontent = theme('webform2pdf_mail2pdf', array('nid'=>$webform2pdf_send2pdf['nid'],'sid'=> $webform2pdf_send2pdf['sid']));
             $attachment->filename = $filename;
             $attachment->filemime = 'application/pdf';
             $message['params']['attachments'][] = $attachment;
