I am trying to send an attachment with Order success email. I have 2 store default and custom. In default store attachment is working perfectly but in custom store. Email not sent.

After debugging I found a line where email stop working:

$this->_drawItem($item, $page, $order);

Under drawItem function code is:

protected function _drawItem(
        \Magento\Framework\DataObject $item,
        \Zend_Pdf_Page $page,
        \Magento\Sales\Model\Order $order
    ) {
        $type = $item->getOrderItem()->getProductType();
        $renderer = $this->_getRenderer($type);


        return $renderer->getPage();

in this file, execution stops after this the following line:-


Please tell me how to send attachment with email in multiple stores.


I would recommend to use the following module to add email attachment to an order


  • I used it. But it's not working for multiple store.
    – temper
    Oct 24 '19 at 8:08

which version of Magento are you using. I ran into issues with Magento 2.3 when I was not able to send any attachment. Please check this link to add an attachment to your email.

I would also suggest you to try the Mpdf library to generate pdf files. It is very easy to use. You can generate your Html using a custom block->to_html() and pass the HTML to Mpdf output(). It will create the file. And after that add the pdf file path to the addAttachment().

URL: issue in magento 2.2.8 send multiple attachment in single mail

I hope it helps!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.