$mpdfConfig =
Shopware()->
Container()->
getParameter('shopware.mpdf.defaultConfig'
);
$mpdf =
new Mpdf($mpdfConfig);
$mpdf->
WriteHTML($data);
$pdfFileContent =
$mpdf->
Output('', 'S'
);
if ($pdfFileContent === false
) { throw new Enlight_Exception('Could not generate SEPA attachment file'
);
} $attachmentName = 'SEPA_' .
$orderNumber;
$mail->
createAttachment( $pdfFileContent,
'application/pdf',
Zend_Mime::DISPOSITION_ATTACHMENT,
Zend_Mime::ENCODING_BASE64,
$attachmentName . '.pdf'
);
$mail->
setAssociation(LogEntryBuilder::ORDER_NUMBER_ASSOCIATION,
$orderNumber);
try { $mail->
send();
}