protected function applyOrderAttachments(
        \Swift_Message $message,
        ApiOrderInterface $apiOrder = null,
        $sendXMLOrder = false
    ) {
        if ($apiOrder) {
            $pdf = $this->pdfManager->createOrderConfirmation($apiOrder);
            $pdfFileName = $this->pdfManager->getPdfName($apiOrder);
            $attachment = \Swift_Attachment::newInstance()
                ->setFilename($pdfFileName)
                ->setContentType('application/pdf')
                ->setBody($pdf);
            $message->attach($attachment);

            if ($sendXMLOrder) {
                $message->attach($this->createXMLAttachment($apiOrder));
            }
        }
    }
protected function applyOrderAttachments(
        \Swift_Message $message,
        ApiOrderInterface $apiOrder = null,
        $sendXMLOrder = false
    ) {
        if ($apiOrder) {
            $pdf = $this->pdfManager->createOrderConfirmation($apiOrder);
            $pdfFileName = $this->pdfManager->getPdfName($apiOrder);
            $attachment = \Swift_Attachment::newInstance()
                ->setFilename($pdfFileName)
                ->setContentType('application/pdf')
                ->setBody($pdf);
            $message->attach($attachment);

            if ($sendXMLOrder) {
                $message->attach($this->createXMLAttachment($apiOrder));
            }
        }
    }
protected function applyOrderAttachments ( \ Swift_Message $ message , ApiOrderInterface $ apiOrder = null , $ sendXMLOrder = false ) { if ( $ apiOrder ) { $ pdf = $ this -> pdfManager -> createOrderConfirmation ( $ apiOrder ) ; $ pdfFileName = $ this -> pdfManager -> getPdfName ( $ apiOrder ) ; $ attachment = \ Swift_Attachment :: newInstance ( ) -> setFilename ( $ pdfFileName ) -> setContentType ( 'application/pdf' ) -> setBody ( $ pdf ) ; $ message -> attach ( $ attachment ) ; if ( $ sendXMLOrder ) { $ message -> attach ( $ this -> createXMLAttachment ( $ apiOrder ) ) ; } } }
Function adds attachments to the email message.

@param \Swift_Message $message
@param ApiOrderInterface $apiOrder
@param bool $sendXMLOrder
Function adds attachments to the email message .