1

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);
        $renderer->setOrder($order);
        $renderer->setItem($item);
        $renderer->setPdf($this);
        $renderer->setPage($page);
        $renderer->setRenderedModel($this);

        $renderer->draw();

        return $renderer->getPage();
    }

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

$renderer->draw();

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

1

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

https://store.fooman.co.nz/magento-extension-email-attachments-m2.html

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

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!

| improve this answer | |

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.